Cross-Compiling with CMake and QtCreator

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Cross-Compiling with CMake and QtCreator

Thorsten Hofer-Schmitz

I want to compile a program for Android. I work on Windows 10. Because I
recently reinstalled my OS everything isn't older than two month. I
Installed everything using Qt's, Android Studio's (and for Windows
Visual Studio's) installers/SDK Manager, to prevent mistakes I might
have made.

I'm not new to programming, but I haven't worked much with build systems
until now, alsways used what QtCreator/VS offers. But I want to do more
and after some research I decided to go with CMake.

So I made a new project in QtCreator (empty QtQuick project template).
Using qmake works fine for both Windows and Android, so the toolchains
should all be fine so far. But when I make the same empty project as
CMake project I get errors for Android. For Windows it works fine so far.

At first CMake didn't find Ninja for Android (but did find it for
Windows). So I added the it's location to PATH.

Now it could find Ninja, but I got

           The C++ compiler


           is not able to compile a simple test program.

I searched on google, and aside from a lot of posts that didn't help at
all, I found this:

suggesting it's caused by CMake trying to run an Android application on
Windows, and to add

           set (CMAKE_C_COMPILER_WORKS 1)
           set (CMAKE_CXX_COMPILER_WORKS 1)

before project() to omit the test. And it now changed the error to

           No known features for CXX compiler


           version 8.0.2.

Again, I googled. But all I could find was related to old bugs or other

So I hope to get some help here now.

Best regards


Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: