CMake error 'The CXX compiler identification is unknown' for Android developing only
-
Hi to all,
I installed QT 6.9.1 on kubuntu linux. I try to compile a demo app, exactly 'calqlatr'.
First I tried to compile as a desktop app. All OK.Then I tried to compile for Android, choosing the x86_64 kit. As I set the kit in the 'Projects' tab, I received the following message:
So, I went to 'General messages' and I read this:
[cmake] Running /home/glafauci61/Programmi/QT6/QT/Tools/CMake/bin/cmake -S /home/glafauci61/Programmi/QT6/QT/Examples/Qt-6.9.1/demos/calqlatr -B /home/glafauci61/Programmi/QT6/QT/Examples/Qt-6.9.1/demos/calqlatr/build/Android_Qt_6_9_1_Clang_x86_64-Debug in /home/glafauci61/Programmi/QT6/QT/Examples/Qt-6.9.1/demos/calqlatr/build/Android_Qt_6_9_1_Clang_x86_64-Debug. [cmake] -- Android: Selected unified Clang toolchain [cmake] -- The CXX compiler identification is unknown [cmake] -- Detecting CXX compiler ABI info [cmake] -- Detecting CXX compiler ABI info - failed [cmake] -- Check for working CXX compiler: /home/glafauci61/Programmi/QT6/SDK-commandLineTools/cmdline-tools/ndk/android-ndk-r28/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ [cmake] -- Check for working CXX compiler: /home/glafauci61/Programmi/QT6/SDK-commandLineTools/cmdline-tools/ndk/android-ndk-r28/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - broken [cmake] CMake Error at /home/glafauci61/Programmi/QT6/QT/Tools/CMake/share/cmake-3.30/Modules/CMakeTestCXXCompiler.cmake:73 (message): [cmake] The C++ compiler [cmake] [cmake] "/home/glafauci61/Programmi/QT6/SDK-commandLineTools/cmdline-tools/ndk/android-ndk-r28/toolchains/llvm/prebuilt/linux-x86_64/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: '/home/glafauci61/Programmi/QT6/QT/Examples/Qt-6.9.1/demos/calqlatr/build/Android_Qt_6_9_1_Clang_x86_64-Debug/CMakeFiles/CMakeScratch/TryCompile-PfFPuk' [cmake] [cmake] Run Build Command(s): /home/glafauci61/Programmi/QT6/QT/Tools/Ninja/ninja -v cmTC_a24ef [cmake] [1/2] /home/glafauci61/Programmi/QT6/SDK-commandLineTools/cmdline-tools/ndk/android-ndk-r28/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -DQT_QML_DEBUG -o CMakeFiles/cmTC_a24ef.dir/testCXXCompiler.cxx.o -c /home/glafauci61/Programmi/QT6/QT/Examples/Qt-6.9.1/demos/calqlatr/build/Android_Qt_6_9_1_Clang_x86_64-Debug/CMakeFiles/CMakeScratch/TryCompile-PfFPuk/testCXXCompiler.cxx [cmake] FAILED: CMakeFiles/cmTC_a24ef.dir/testCXXCompiler.cxx.o [cmake] /home/glafauci61/Programmi/QT6/SDK-commandLineTools/cmdline-tools/ndk/android-ndk-r28/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -DQT_QML_DEBUG -o CMakeFiles/cmTC_a24ef.dir/testCXXCompiler.cxx.o -c /home/glafauci61/Programmi/QT6/QT/Examples/Qt-6.9.1/demos/calqlatr/build/Android_Qt_6_9_1_Clang_x86_64-Debug/CMakeFiles/CMakeScratch/TryCompile-PfFPuk/testCXXCompiler.cxx [cmake] /home/glafauci61/Programmi/QT6/SDK-commandLineTools/cmdline-tools/ndk/android-ndk-r28/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++: 1: clang: not found [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:5 (project) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] [cmake] The command "/home/glafauci61/Programmi/QT6/QT/Tools/CMake/bin/cmake -S /home/glafauci61/Programmi/QT6/QT/Examples/Qt-6.9.1/demos/calqlatr -B /home/glafauci61/Programmi/QT6/QT/Examples/Qt-6.9.1/demos/calqlatr/build/Android_Qt_6_9_1_Clang_x86_64-Debug" terminated with exit code 1. [cmake] [cmake] Elapsed time: 00:00.
Surprised, I went back to Desktop kit and retried: the compilation is OK, and the app runs perfectly.
I tried to use other android kits, but all of them fails with the same output.
Anyone can help me?
-
Hello, I solved the problem uninstalling all QT suite and reinstalling it.
Everything is fine.Bye
-