Issue building OpenCV 3.4.3 for Android

asked 2019-10-18 04:38:45 -0500

david.serrano gravatar image

Hi,

I'm following a guide to build OpenCV 3.3.x for Android on Windows (http://amin-ahmadi.com/2017/08/13/how...) and I've followed all the steps in it, but the configuration fails with the following issue:

The C++ compiler

    "D:/androidNdks/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: D:/dev/opencv-3.4.3/android_build/CMakeFiles/CMakeTmp

    Run Build Command(s):D:/Programs/CMake/bin/cmake.exe cmTC_fc979/fast && CMake Error: The source directory "D:/dev/opencv-3.4.3/android_build/CMakeFiles/CMakeTmp/cmTC_fc979/fast" does not exist.
    Specify --help for usage, or press the help button on the CMake GUI.

I've tried with the following variations:

  • ANDROID_NDK: D/AndroidNdks/android-ndk-r15c
  • ANDROID_NDK: D/AndroidNdks/android-ndk-r16b
  • Using the cmake exe from Cmake: D:\Programs\CMake\bin
  • Using the make exe from Mingw: D:\Programs\Mingw\msys\1.0\bin
  • Updating the toolchain used from the CMake GUI
  • Swapping between Mingw Makefiles and MSYS Makefiles

I've also run CMake as an admin to make sure there are no write permission issues.

From looking online i think it's also worth noting that ma CMakeLists file is unchanged from the one downloaded from the source files (here)

Any help or pointers as to what i may be doing wrong would be greatly appreciated!

Thanks, David

edit retag flag offensive close merge delete