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

后端 未结 1 1569
无人共我
无人共我 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条回答
  • 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:

    <cmake.exe>  -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=<install_path> -DCMAKE_TOOLCHAIN_FILE="<androidNDK_path>\build\cmake\android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM="<MinGW_path>\msys\1.0\bin\make.exe" -DANDROID_TOOLCHAIN=gcc -DANDROID_ABI="armeabi-v7a with NEON" --DCMAKE_BUILD_TYPE="Debug" <source>
    
    0 讨论(0)
提交回复
热议问题