Ask Your Question

28o87e's profile - activity

2015-10-22 15:02:57 -0600 received badge  Notable Question (source)
2014-10-15 09:06:06 -0600 received badge  Popular Question (source)
2013-08-24 02:56:14 -0600 received badge  Student (source)
2013-08-23 06:01:14 -0600 received badge  Editor (source)
2013-08-23 05:59:46 -0600 asked a question Building OpenCv4Android: CMAKE_CXX_COMPILER_ENV_VAR not set

I'm trying to build OpenCv4Android on OSX using the instructions found here.

They seem to be slightly out of date, as they reference the old location of the git respository, and say I should be doing this:

cd opencv/android
sh ./scripts/cmake_android.sh

Whereas in the current repository, scripts live in platforms/scripts, so I'm doing this:

sh /platforms/scripts/cmake_android_arm.sh

However, that produces the following error:

➜  opencv git:(master) ✗ ./platforms/scripts/cmake_android_arm.sh 
CMake Error at platforms/android/android.toolchain.cmake:694 (message):
  Could not find any working toolchain in the NDK.  Probably your Android NDK
  is broken.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/2.8.11.2/share/cmake/Modules/CMakeDetermineSystem.cmake:90 (include)
  CMakeLists.txt:45 (project)


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/dan/workspace/opencv/platforms/build_android_arm/CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake
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/dan/workspace/opencv/platforms/build_android_arm/CMakeFiles/2.8.11.2/CMakeCCompiler.cmake
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

Despite the error message, I'm using a clean installation of the NDK and have it set on $ANDROID_NDK.

Any ideas what I'm doing wrong?