3

So I am having this very annoying problem with Qt Creator. When I try to build any application I get the following:

.../NDK/android-ndk-r19c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++: not found Project ERROR: Cannot run target compiler

Now I have read here that this might be because of due to Android Studio and this can be solved just downloading the NDK separately from Google's website. So far I have tried the following things:

  • Removed Android Studio

  • Installed the SDK tools separately

  • Installed the NDK separately

  • Downgraded my JDK version to 8

  • Tried with different versions of the NDK (I have tried 20,19 and 18)

However none of these solutions work. I am using Qt Creator 4.9.2 with Qt 5.13.

shizhen
  • 12,251
  • 9
  • 52
  • 88
reckless
  • 741
  • 12
  • 53
  • did you check that path? if it's not there, is it elsewhere? – Cruz Jean Jul 04 '19 at 13:36
  • No it's not there. I wonder why Qt Creator is looking for g++ and not clang. – reckless Jul 04 '19 at 13:46
  • Well if it's looking for g++ instead of gcc it would probably need clang++, not clang. But have you performed a full system search for the file name it's looking for? It's probably just looking in the wrong place. You can change that in settings. – Cruz Jean Jul 04 '19 at 13:59

2 Answers2

2

Since ndk r19, the toolchains are already completely changed to llvm/clang, see here: https://stackoverflow.com/a/54800967/8034839 for more details.

From your error message, it looks you set the toolchain to gcc rather than clang, which might be the problem.

shizhen
  • 12,251
  • 9
  • 52
  • 88
0

What worked for me was setting the correct path to the toolchain I want to use

i.e. After Downloading and extracting the correct toolchain (r15c in my case) set the ANDROID_NDK_ROOT to that specific path of the (r15c) toolchain root folder without the ending "/".

Projects>Build & Run>Android for ...(Specific Platform)>Build>Build Environment>ANDROID_NDK_ROOT.

And it worked like a charm.

Yatin Khurana
  • 89
  • 1
  • 5