5

I am trying to compile a CMake project for android.

I use QtCreator to create and compile the project. Using QMake works fine, but CMake projects don't work.

CMake Project parsing failed. Running "C:\Android\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe -E server "--pipe=\\.\pipe\{78eb9a25-fbdf-4ac7-b840-8cfe89cbd883}" --experimental" in C:\Users\Thorsten\AppData\Local\Temp\QtCreator-Zmienl\qtc-cmake-KUabkXqG. Starting to parse CMake project, using: "-DCMAKE_CXX_COMPILER:STRING=C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe", "-DCMAKE_C_COMPILER:STRING=C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe", "-DCMAKE_PREFIX_PATH:STRING=C:/Qt/5.13.0/android_x86_64", "-DQT_QMAKE_EXECUTABLE:STRING=C:/Qt/5.13.0/android_x86_64/bin/qmake.exe". The CXX compiler identification is Clang 8.0.2 Check for working CXX compiler: C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe Check for working CXX compiler: C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -- broken CMake Error at C:/Android/android-sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCXXCompiler.cmake:45 (message): The C++ compiler "C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: C:/Users/Thorsten/AppData/Local/Temp/QtCreator-Zmienl/qtc-cmake-KUabkXqG/CMakeFiles/CMakeTmp Run Build Command:"C:/Android/android-sdk/cmake/3.10.2.4988404/bin/ninja.exe" "cmTC_622f7" [1/2] Building CXX object CMakeFiles/cmTC_622f7.dir/testCXXCompiler.cxx.obj [2/2] Linking CXX executable cmTC_622f7.exe FAILED: cmTC_622f7.exe cmd.exe /C "cd . && C:\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe CMakeFiles/cmTC_622f7.dir/testCXXCompiler.cxx.obj -o cmTC_622f7.exe -Wl,--out-implib,libcmTC_622f7.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ." clang++.exe: error: unable to execute command: program not executable clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:8 (project) Configuring incomplete, errors occurred! See also "C:/Users/Thorsten/AppData/Local/Temp/QtCreator-Zmienl/qtc-cmake-KUabkXqG/CMakeFiles/CMakeOutput.log". See also "C:/Users/Thorsten/AppData/Local/Temp/QtCreator-Zmienl/qtc-cmake-KUabkXqG/CMakeFiles/CMakeError.log". CMake Project parsing failed. 

I found several posts about this, but most of them were not answered or simply not useful. I found this helpful, so I added

SET (CMAKE_C_COMPILER_WORKS 1) SET (CMAKE_CXX_COMPILER_WORKS 1) 

before project(). But now I get

CMake Error in CMakeLists.txt: No known features for CXX compiler "Clang" version 8.0.2. CMake Project parsing failed. 

So far I haven't found something useful for that.

I hope I can get some more help this way.

ps: I recently reinstalled my os (Windows 10), so if I forgot to update something it's not older than two month. I let QtCreator, Visual Studio and Android Studio do the installation of the toolchains.

pps: The project is a new project created by QtCreator

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.