1

Android Studio has updated the NDK to r-18, which seems to have changed the C++ compiler, but it isn't clear what is wrong. We get the following error:

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage

The samples that comes with Superpowered release 1.2.4 also have this error when using Android Studio 3.2 RC3 with NDK-r18.

What needs to be done to fix the compilation?

Jim Leask
  • 6,159
  • 5
  • 21
  • 31
  • Are you using the CMake that comes with the SDK, or a newer version? It's a weird error to get since the way the NDK toolchain file is written it shouldn't be possible for `CMAKE_C_COMPILER` to get set to nothing. – Dan Albert Sep 24 '18 at 21:45
  • Not sure actually, but I'll try to check. This was set up initially with NDK-r17, and from looking into it it seems that it was using a different C++ compiler. – Jim Leask Sep 24 '18 at 22:10
  • Have you upgraded the gradle plugin when you shed NDK release? – Alex Cohn Sep 25 '18 at 04:16

2 Answers2

1

Superpowered uses gnustl which has been removed from NDK r18.

A recent answer on GitHub suggests that you can simply set ANDROID_STL to c++_static to resolve the problem with some Superpowered samples. Be careful with this approach, it may have sideeffects at runtime.

It might be safer to stay with NDK r17 until the new release is officially embraced by the library.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • Makes sense. Changing to `c++_static` worked with NDK-r18, however, I think it is good advice to follow up with Superpowered and get the new release that officially supports this compiler. I'm not blocked any more though. – Jim Leask Sep 25 '18 at 14:27
  • 1
    Android Studio 3.2 and NDK-r18 has just gone GA, and Superpowered just updated their libraries to fix this. If you get the latest SP build this should now be fixed. – Jim Leask Sep 25 '18 at 16:04
1

Superpowered has been updated to NDK r18 and Android Studio 3.2.

Gabor Szanto
  • 1,329
  • 8
  • 12