Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt Creator 16.0.1, Qt Creator 17.0.0
-
None
-
-
fc5d289e7 (16.0)
Description
Qt Creator 16.0.1 using CMake 4.0.1 can't configure a project using Qt and Qt 6.9.0 kit.
The error message is:
[cmake] Running /opt/homebrew/Cellar/cmake/4.0.1/bin/cmake -S /Users/cristian/Projects/HelloCpp -B /Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug -DCMAKE_GENERATOR:STRING=Ninja -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON -DCMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -DQT_QMAKE_EXECUTABLE:FILEPATH=/Users/cristian/Qt/6.9.0/macos/bin/qmake -DCMAKE_PREFIX_PATH:PATH=/Users/cristian/Qt/6.9.0/macos -DQT_MAINTENANCE_TOOL:FILEPATH=/Users/cristian/Qt/MaintenanceTool.app/Contents/MacOS/MaintenanceTool -DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG -DCMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug/.qtc/package-manager/auto-setup.cmake in /Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug. [cmake] -- The CXX compiler identification is AppleClang 16.0.0.16000026 [cmake] -- Detecting CXX compiler ABI info [cmake] -- Detecting CXX compiler ABI info - failed [cmake] -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ [cmake] -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - broken [cmake] CMake Error at /opt/homebrew/Cellar/cmake/4.0.1/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message): [cmake] The C++ compiler [cmake] [cmake] "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" [cmake] [cmake] is not able to compile a simple test program. [cmake] [cmake] It fails with the following output: [cmake] [cmake] Change Dir: '/Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug/CMakeFiles/CMakeScratch/TryCompile-ykHfcH' [cmake] [cmake] Run Build Command(s): /opt/homebrew/bin/ninja -v cmTC_83ab0 [cmake] [1/2] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DQT_QML_DEBUG -arch arm64 -MD -MT CMakeFiles/cmTC_83ab0.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_83ab0.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_83ab0.dir/testCXXCompiler.cxx.o -c /Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug/CMakeFiles/CMakeScratch/TryCompile-ykHfcH/testCXXCompiler.cxx [cmake] [2/2] : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DQT_QML_DEBUG -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_83ab0.dir/testCXXCompiler.cxx.o -o cmTC_83ab0 && : [cmake] FAILED: cmTC_83ab0 [cmake] : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DQT_QML_DEBUG -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_83ab0.dir/testCXXCompiler.cxx.o -o cmTC_83ab0 && : [cmake] ld: library 'c++' not found [cmake] clang++: error: linker command failed with exit code 1 (use -v to see invocation) [cmake] ninja: build stopped: subcommand failed. [cmake] [cmake] [cmake] [cmake] [cmake] [cmake] CMake will not be able to correctly generate this project. [cmake] Call Stack (most recent call first): [cmake] CMakeLists.txt:3 (project) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] [cmake] The command "/opt/homebrew/Cellar/cmake/4.0.1/bin/cmake -S /Users/cristian/Projects/HelloCpp -B /Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug -DCMAKE_GENERATOR:STRING=Ninja -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON -DCMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -DQT_QMAKE_EXECUTABLE:FILEPATH=/Users/cristian/Qt/6.9.0/macos/bin/qmake -DCMAKE_PREFIX_PATH:PATH=/Users/cristian/Qt/6.9.0/macos -DQT_MAINTENANCE_TOOL:FILEPATH=/Users/cristian/Qt/MaintenanceTool.app/Contents/MacOS/MaintenanceTool -DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG -DCMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug/.qtc/package-manager/auto-setup.cmake" terminated with exit code 1. [cmake] [cmake] Elapsed time: 00:00.
The compiled in the Kit was set as:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
.
If I change the compiler to:
/usr/bin/clang++
Then the configuration step of the project works:
[cmake] Running /opt/homebrew/Cellar/cmake/4.0.1/bin/cmake -S /Users/cristian/Projects/HelloCpp -B /Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug -DCMAKE_GENERATOR:STRING=Ninja -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DQT_QMAKE_EXECUTABLE:FILEPATH=/Users/cristian/Qt/6.9.0/macos/bin/qmake -DCMAKE_PREFIX_PATH:PATH=/Users/cristian/Qt/6.9.0/macos -DQT_MAINTENANCE_TOOL:FILEPATH=/Users/cristian/Qt/MaintenanceTool.app/Contents/MacOS/MaintenanceTool -DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug/.qtc/package-manager/auto-setup.cmake in /Users/cristian/Projects/HelloCpp/build/Qt_6_9_0_for_macOS-Debug. [cmake] -- The CXX compiler identification is AppleClang 16.0.0.16000026 [cmake] -- Detecting CXX compiler ABI info [cmake] -- Detecting CXX compiler ABI info - done [cmake] -- Check for working CXX compiler: /usr/bin/clang++ - skipped [cmake] -- Detecting CXX compile features [cmake] -- Detecting CXX compile features - done