Unable to build example projects due to CMake error
-
I am trying out Qt for the first time. When I tried to build the coffee machine example, CMake gave this error, and I haven't been able to solve it.
Running C:\cygwin64\bin\cmake.exe -S C:/Qt/Examples/Qt-6.5.1/demos/calqlatr -B C:/Qt/Examples/Qt-6.5.1/demos/build-calqlatr-Desktop_Qt_6_5_1_MinGW_64_bit-Debug in C:\Qt\Examples\Qt-6.5.1\demos\build-calqlatr-Desktop_Qt_6_5_1_MinGW_64_bit-Debug. -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:5 (project): The CMAKE_CXX_COMPILER: C:/Qt/Tools/mingw1120_64/bin/g++.exe is not a full path and was not found in the PATH. Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. -- Configuring incomplete, errors occurred! CMake process exited with exit code 1.
-
@jasoney said in Unable to build example projects due to CMake error:
I still get the same error
Remove the build dir and run cmake again, if it still complains about it you still have a cygwin PATH somewhere - remove it.
-
@jasoney said in Unable to build example projects due to CMake error:
C:/Qt/Tools/mingw1120_64/bin/g++.exe
So is this path correct?
-
-
What QtCreator version do you use?
Can you open a command prompt and try to execute g++ (with full path and correct separators)? -
@Christian-Ehrlicher
I am using QT Creator 10.0.2
RunningC:\Qt\Tools\mingw1120_64\bin\g++.exe --version
:g++.exe (x86_64-posix-seh-rev3, Built by MinGW-W64 project) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
@jasoney said in Unable to build example projects due to CMake error:
C:\cygwin64\bin\cmake.exe
I'm not sure but can't you install CMake via Qt installer?
-
Using the QT CMake installation gives me this error:
Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Qt/Examples/Qt-6.5.1/demos/coffee -B C:/Qt/Examples/Qt-6.5.1/demos/build-coffee-Desktop_Qt_6_5_1_MinGW_64_bit-Debug in C:\Qt\Examples\Qt-6.5.1\demos\build-coffee-Desktop_Qt_6_5_1_MinGW_64_bit-Debug. CMake Error at CMakeLists.txt:5 (project): Running '/cygdrive/c/Qt/Tools/Ninja/ninja.exe' '--version' failed with: The system cannot find the file specified
-
Remove all cygwin related stuff from your PATH env var.
-
@Christian-Ehrlicher I still get the same error
-
@jasoney said in Unable to build example projects due to CMake error:
I still get the same error
Remove the build dir and run cmake again, if it still complains about it you still have a cygwin PATH somewhere - remove it.
-
@Christian-Ehrlicher Fixed it 👍 Thank you
-