“The C Compiler […] is not able to compile a simple test program” using CMake and Android NDK

后端 未结 1 1570
无人共我
无人共我 2021-01-22 11:08

I\'m currently testing the Visual Studio 2017 RC CMake support for Android NDK C++ projects on Windows and encountered an issue.

When I try to generate the CMake cache w

1条回答
  •  闹比i
    闹比i (楼主)
    2021-01-22 11:22

    For everybody who finds this post and has the same issue: the problem seems to be the Visual Studio generator. Also it seems like the Android toolchains requires an argument with the path to "make". So to solve both I installed MSYS (http://www.mingw.org/wiki/MSYS) and changed the CMake command to:

      -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_TOOLCHAIN_FILE="\build\cmake\android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM="\msys\1.0\bin\make.exe" -DANDROID_TOOLCHAIN=gcc -DANDROID_ABI="armeabi-v7a with NEON" --DCMAKE_BUILD_TYPE="Debug" 
    

    0 讨论(0)
提交回复
热议问题