【发布时间】:2016-12-27 14:11:33
【问题描述】:
我目前正在 Windows 上测试 Visual Studio 2017 RC CMake 对 Android NDK C++ 项目的支持并遇到问题。
当我尝试使用以下命令生成 CMake 缓存时:
<cmake.exe> -G "Visual Studio 15 2017" -DCMAKE_INSTALL_PREFIX:PATH=<install_path> -DCMAKE_TOOLCHAIN_FILE="<androidNDK_path>\build\cmake\android.toolchain.cmake" -DANDROID_TOOLCHAIN=gcc -DANDROID_ABI="armeabi-v7a with NEON" --DCMAKE_BUILD_TYPE="Debug" <source>
我收到以下错误(如果我不强制 gcc,clang 也会发生同样的情况):
The C compiler "<androidNDK_path>/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe" is not able to compile a simple test program.
在此之前,我收到警告说 C 和 CXX 编译器的标识未知,但我不确定这是否相关。
我在临时测试项目中遇到了更多错误,但它们似乎没有提供很多信息,例如
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(57,5):
error MSB4018: The "VCMessage" task failed unexpectedly.
和
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(57,5):
error MSB4018: System.FormatException: Index (zero based) must be greater
than or equal to zero and less than the size of the argument list.
我该如何解决这个问题?
【问题讨论】:
标签: c++ android-ndk cmake cross-platform visual-studio-2017