Box2D-cocos2d-x icon indicating copy to clipboard operation
Box2D-cocos2d-x copied to clipboard

您好,请教个问题,在执行./build_android.sh编译时报如下错误,ndk版本与您脚本中相同r9

Open MarkLi2011 opened this issue 8 years ago • 2 comments

Host system 'darwin-x86_64' is not supported by the source NDK! Try --system= with one of: windows-x86_64 Host system 'darwin-x86_64' is not supported by the source NDK! Try --system= with one of: windows-x86_64 CMake Error at toolchain/android.toolchain.cmake:562 (message): Could not find neither Android NDK nor Android standalone toolchain.

  You should either set an environment variable:
    export ANDROID_NDK=~/my-android-ndk
  or
    export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain
  or put the toolchain or NDK in the default path:
    sudo ln -s ~/my-android-ndk /opt/android-ndk
    sudo ln -s ~/my-android-toolchain /opt/android-toolchain

Call Stack (most recent call first): /usr/share/cmake-3.3.2/Modules/CMakeDetermineSystem.cmake:95 (include)

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: /Box2D-cocos2d-x-master/Box2D/build.android/CMakeFiles/3.3.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: /Box2D-cocos2d-x-master/Box2D/build.android/CMakeFiles/3.3.2/CMakeCXXCompiler.cmake CMake Error in : No CMAKE_C_COMPILER could be found.

Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error in : No CMAKE_CXX_COMPILER could be found.

Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! make: *** 没有指明目标并且找不到 makefile。 停止。 CMake Error at toolchain/android.toolchain.cmake:562 (message): Could not find neither Android NDK nor Android standalone toolchain.

  You should either set an environment variable:
    export ANDROID_NDK=~/my-android-ndk
  or
    export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain
  or put the toolchain or NDK in the default path:
    sudo ln -s ~/my-android-ndk /opt/android-ndk
    sudo ln -s ~/my-android-toolchain /opt/android-toolchain

Call Stack (most recent call first): /usr/share/cmake-3.3.2/Modules/CMakeDetermineSystem.cmake:95 (include)

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: /Box2D-cocos2d-x-master/Box2D/build.android/CMakeFiles/3.3.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: /Box2D-cocos2d-x-master/Box2D/build.android/CMakeFiles/3.3.2/CMakeCXXCompiler.cmake CMake Error in : No CMAKE_C_COMPILER could be found.

Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error in : No CMAKE_CXX_COMPILER could be found.

Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! make: *** 没有指明目标并且找不到 makefile。 停止。 CMake Error at toolchain/android.toolchain.cmake:562 (message): Could not find neither Android NDK nor Android standalone toolchain.

  You should either set an environment variable:
    export ANDROID_NDK=~/my-android-ndk
  or
    export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain
  or put the toolchain or NDK in the default path:
    sudo ln -s ~/my-android-ndk /opt/android-ndk
    sudo ln -s ~/my-android-toolchain /opt/android-toolchain

Call Stack (most recent call first): /usr/share/cmake-3.3.2/Modules/CMakeDetermineSystem.cmake:95 (include)

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: /Box2D-cocos2d-x-master/Box2D/build.android/CMakeFiles/3.3.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: /Box2D-cocos2d-x-master/Box2D/build.android/CMakeFiles/3.3.2/CMakeCXXCompiler.cmake CMake Error in : No CMAKE_C_COMPILER could be found.

Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error in : No CMAKE_CXX_COMPILER could be found.

Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! make: *** 没有指明目标并且找不到 makefile。 停止。 mv: 无法获取'libs/*' 的文件状态(stat): No such file or directory

MarkLi2011 avatar Oct 09 '16 02:10 MarkLi2011

好像是ANDROID_STANDALONE_TOOLCHAIN环境导致,这个路径是不是要指向./android-ndk-r9d/toolchains目录?

MarkLi2011 avatar Oct 09 '16 03:10 MarkLi2011

--system参数改为windows-x86_64可以生成对应平台的toolchain,我是在windows下用cygwin64环境编译,这样修改之后暂时还不知道后续编译是否有问题...

MarkLi2011 avatar Oct 09 '16 03:10 MarkLi2011