Building Qt-Creator fails [windows]
-
Hello all, im trying to build qt from sources. I have tried to configure the project with cmake prebuilding and the following output occurs (errors...):
**Microsoft Windows [Version 10.0.20348.768]
(c) Microsoft Corporation. All rights reserved.C:\Users\Administrator>cd C:\Users\Administrator\Desktop\qt-creator\qt_build
C:\Users\Administrator\Desktop\qt-creator\qt_build>cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja "-DCMAKE_PREFIX_PATH=C:\Qt\Tools\QtCreator\bin;C:\Users\Administrator\Desktop\android-ndk-r23c-windows\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\bin" C:\Users\Administrator\Desktop\qt-creator\src
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such asproject(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Administrator/Desktop/qt-creator/qt_build/CMakeFiles/CMakeTmp Run Build Command(s):C:/Ninja/ninja.exe cmTC_848ba && [1/2] Building C object CMakeFiles\cmTC_848ba.dir\testCCompiler.c.obj [2/2] Linking C executable cmTC_848ba.exe FAILED: cmTC_848ba.exe cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_848ba.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_848ba.dir\testCCompiler.c.obj /out:cmTC_848ba.exe /implib:cmTC_848ba.lib /pdb:cmTC_848ba.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." RC Pass 1: command "rc /fo CMakeFiles\cmTC_848ba.dir/manifest.res CMakeFiles\cmTC_848ba.dir/manifest.rc" failed (exit code 0) with the following output: The system cannot find the file specified ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt-- Configuring incomplete, errors occurred!
See also "C:/Users/Administrator/Desktop/qt-creator/qt_build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Administrator/Desktop/qt-creator/qt_build/CMakeFiles/CMakeError.log".** -
the command was: cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja "-DCMAKE_PREFIX_PATH=C:\Qt\Tools\QtCreator\bin;C:\Users\Administrator\Desktop\android-ndk-r23c-windows\android-ndk-r23c\toolchains\llvm\prebuilt\windows-x86_64\bin" C:\Users\Administrator\Desktop\qt-creator\src
-
How are you trying to build Qt Creator? I can see Android there, but also Visual Studio 2022. Not a very common case.
Qt Creator has in the documentation https://code.qt.io/cgit/qt-creator/qt-creator.git/about/ information about the build procedure.
In essence it's like:
$ "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" $ cmake -D CMAKE_BUILD_TYPE=Debug -G Ninja -D CMAKE_PREFIX_PATH=c:/Qt/6.3.1/msvc2019_64 -S c:/Projects/QtCreator -B c:/Projects/QtCreator-Build-Debug $ cmake --build c:/Projects/QtCreator-Build-Debug