我想建立一些使用Android NdK獨立工具鏈。但是,我遇到了這些錯誤。cmake失敗與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變量,但沒有幫助。
任何想法從哪裏開始?
謝謝。
我應該在Windows下指向ANDROID_STANDALONE_TOOLCHAIN?我設置了「C:\ cygwin64 \ bin」,但沒有工作。我仍然有問題:https://github.com/realm/realm-java/issues/4070#issuecomment-274723770 – 2017-01-24 07:15:54