QT build from source in windows 10 (shellscalingapi.h not found)
-
I am getting the following error when i try to compile QT in static mode:
C:/Programs/Qt/Static/Src/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp:93:10: fatal error: shellscalingapi.h: No such file or directory #include <shellscalingapi.h> ^~~~~~~~~~~~~~~~~~~ compilation terminated. [1538/8790] Building CXX object qtbase/src/plugins/platfor...Files/QWindowsIntegrationPlugin.dir/qwindowscursor.cpp.obj ninja: build stopped: subcommand failed.I use this command in CMD and in QT source code folder directory:
configure.bat -release -static -prefix C:\Programs\Qt\Static\build-static -xcband after configuration completed, i use this command :
cmake --build . --paralleland i get that error before build complete. my OS is Windows 10. QT version is 6.3.1.
I also build QT in static mode on ubuntu20 and macOS without any problem, with same source files.i try instructions in this link:
https://doc.qt.io/qt-6/windows-building.html
i installed cmake, perl, python and ninja and all of them are visible in CMD but this error seen. all of these steps done with MinGW11.2 compiler. then i try to install MSVC compiler and try again but nothing changed. i guess the configure.bat file cannot detect MSVC and works with MinGW.
how can i solve this problem? (with any of these compilers) -
I am getting the following error when i try to compile QT in static mode:
C:/Programs/Qt/Static/Src/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp:93:10: fatal error: shellscalingapi.h: No such file or directory #include <shellscalingapi.h> ^~~~~~~~~~~~~~~~~~~ compilation terminated. [1538/8790] Building CXX object qtbase/src/plugins/platfor...Files/QWindowsIntegrationPlugin.dir/qwindowscursor.cpp.obj ninja: build stopped: subcommand failed.I use this command in CMD and in QT source code folder directory:
configure.bat -release -static -prefix C:\Programs\Qt\Static\build-static -xcband after configuration completed, i use this command :
cmake --build . --paralleland i get that error before build complete. my OS is Windows 10. QT version is 6.3.1.
I also build QT in static mode on ubuntu20 and macOS without any problem, with same source files.i try instructions in this link:
https://doc.qt.io/qt-6/windows-building.html
i installed cmake, perl, python and ninja and all of them are visible in CMD but this error seen. all of these steps done with MinGW11.2 compiler. then i try to install MSVC compiler and try again but nothing changed. i guess the configure.bat file cannot detect MSVC and works with MinGW.
how can i solve this problem? (with any of these compilers) -
thanks for your reply. I googled for this and most of answers says to comment out related codes. this library used for high-DPI scaling and its not necessary but i don't want to loss this feature. i found it only in this directory:
C:\Programs\Qt\Tools\mingw1120_64\x86_64-w64-mingw32\include
but compiler can not find it. how can i add this directory to compiler include path? trying to add this directory to "path" in system environment variables doesn't effect because its related to windows not to ninja.
-
@vakh said in QT build from source in windows 10 (shellscalingapi.h not found):
but compiler can not find it. how can i add this directory to compiler include path?
If you use the gcc from C:\Programs\Qt\Tools\mingw1120_64\bin, the directory is part of the compiler default include path. Which gcc are you using (which path shows up if you run "where gcc")?
-
@vakh said in QT build from source in windows 10 (shellscalingapi.h not found):
but compiler can not find it. how can i add this directory to compiler include path?
If you use the gcc from C:\Programs\Qt\Tools\mingw1120_64\bin, the directory is part of the compiler default include path. Which gcc are you using (which path shows up if you run "where gcc")?
-
@kkoehne
It is the output of CMD:Microsoft Windows [Version 10.0.19043.1110] (c) Microsoft Corporation. All rights reserved. Z:\>where gcc C:\Programs\Qt\Tools\mingw1120_64\bin\gcc.exe C:\Programs\Strawberry\c\bin\gcc.exeit seems true.
-
@vakh You are apparently usingf wrong compiler!
Start from scratch: delete build folder, create new one and continue with the build. It should now pick up the correct compiler.@jsulm thanks a lot. after I see your answer, I tested it. the problem solved. but another problem appeared.

is it for little RAM? my system is intel core i5 6500T with 8 GB RAM and 58 GB free space on drive C. (I test this procedure two times and it failed because of low space on memory. then i solve it but now it failed with this error). -
@jsulm thanks a lot. after I see your answer, I tested it. the problem solved. but another problem appeared.

is it for little RAM? my system is intel core i5 6500T with 8 GB RAM and 58 GB free space on drive C. (I test this procedure two times and it failed because of low space on memory. then i solve it but now it failed with this error).@vakh said in QT build from source in windows 10 (shellscalingapi.h not found):
is it for little RAM?
Yes. You can limit the number of parallel compiler processes using make instead of ninja. For example to only use 4 processes do: make -j 4.
-
thanks a lot! QT static compile successfully done :)
now after adding this new qmake.exe to project development kit, I face a new problem. As I said before, doing this steps in ubuntu and macOS solved the need for shared libraries and application works without any problems in other computers (without QT installation). but here after doing all of these steps, application in windows need other libraries like "libgcc_s_seh-1.dll". how can I solve this problem? -
thanks a lot! QT static compile successfully done :)
now after adding this new qmake.exe to project development kit, I face a new problem. As I said before, doing this steps in ubuntu and macOS solved the need for shared libraries and application works without any problems in other computers (without QT installation). but here after doing all of these steps, application in windows need other libraries like "libgcc_s_seh-1.dll". how can I solve this problem?@vakh said in QT build from source in windows 10 (shellscalingapi.h not found):
how can I solve this problem?
Well, you would also have to compile all these libraries as static libraries and rebuild your app...
-
@vakh said in QT build from source in windows 10 (shellscalingapi.h not found):
how can I solve this problem?
Well, you would also have to compile all these libraries as static libraries and rebuild your app...
