我正在尝试使用 Android NdK 独立工具链构建一些东西。但是,我遇到了这些错误。
CMake Warning at cmake/android.toolchain.cmake:387 (message):
Using value of obsolete variable ANDROID_NDK_TOOLCHAIN_ROOT as initial
value for ANDROID_STANDALONE_TOOLCHAIN. Please note, that
ANDROID_NDK_TOOLCHAIN_ROOT can be completely removed in future versions of
the toolchain.
Call Stack (most recent call first):
cmake/android.toolchain.cmake:476 (__INIT_VARIABLE)
/usr/local/Cellar/cmake/2.8.10.2/share/cmake/Modules/CMakeDetermineSystem.cmake:86 (include)
CMakeLists.txt:16 (PROJECT)
CMake Error at cmake/android.toolchain.cmake:412 (FILE):
file STRINGS file
"/Users/vgokhale/Desktop/android-ndk-r8e/sysroot/usr/include/android/api-level.h"
cannot be read.
Call Stack (most recent call first):
cmake/android.toolchain.cmake:548 (__DETECT_NATIVE_API_LEVEL)
/usr/local/Cellar/cmake/2.8.10.2/share/cmake/Modules/CMakeDetermineSystem.cmake:86 (include)
CMakeLists.txt:16 (PROJECT)
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/Users/vgokhale/Desktop/torch-android/src/build/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/Users/vgokhale/Desktop/torch-android/src/build/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
make: *** No rule to make target `install'. Stop.
有两组错误。我不知道从哪里开始第一组。android.toolchain.cmake 文件默认进入 sysroot,但没有安装 android,Google 也不需要我在那里安装它。
关于 CMAKE 变量,我发现大多数解决方案都涉及安装我已经拥有的开发人员工具。我尝试手动设置 CXX 和 CC 变量,但没有帮助。
关于从哪里开始的任何想法?
谢谢你。