cmake的失败与Android NDK [英] cmake fails with android ndk

查看:5447
本文介绍了cmake的失败与Android NDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Android NDK工具链独立打造的东西。然而,我遇到了这些错误。

I am trying to build something using the Android NdK standalone toolchain. However, I am running into these errors.

        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不安装有没有谷歌是否要求我到那里安装。

There are two sets of errors. I have no idea where to begin with the first set. The android.toolchain.cmake file looks into sysroot by default but android is not installed there neither does Google require me to install it there.

关于CMake的变量,我发现大多数解决方案涉及到安装开发工具,这一点我已经有了。我试着手动设置CXX和CC变量,但没有帮助。

Regarding the CMAKE variables, I found that most solutions involve installing Developer Tools, which I already have. I tried manually setting the CXX and CC variables but that did not help.

任何想法从哪里开始?

感谢您。

推荐答案

好吧,我会做一些猜测在这里,但我认为你正在使用的 HTTP://$c$c.google.com/p/android-cmake/ 以及你与ANDROID_STANDALONE_TOOLCHAIN​​调用它同时提供它的路径NDK。如果我是正确的,这就是问题所在。

Ok, I'll do a bit of guesswork here, but I think you're using http://code.google.com/p/android-cmake/ and you're calling it with ANDROID_STANDALONE_TOOLCHAIN while providing it the path to your NDK. If I'm right, that's the problem.

您应该要么ANDROID_NDK调用它并提供给您的NDK的路径。
而Android-cmake的文件表明,这是要走的路。

You should either call it with ANDROID_NDK and provide the path to your NDK. The android-cmake documentation suggests that this is the way to go.

请与ANDROID_STANDALONE_TOOLCHAIN​​调用它,但它提供的路径,安装的toochain(与make-standalone-toolchain.sh创建的东西)

Keep calling it with ANDROID_STANDALONE_TOOLCHAIN, but providing it the path to an installed toochain (something created with make-standalone-toolchain.sh)

如果你想要走这条路,你可以找到有关的文档创建独立的工具链/ STANDALONE-TOOLCHAIN​​.html在安装NDK的信息。

If you want to go this way, you can find information about creating standalone toolchains in docs/STANDALONE-TOOLCHAIN.html in your installed NDK.

这篇关于cmake的失败与Android NDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆