Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error building Opencv 2.4.13 for Android with CMAKE

Dear community,

last week I tried to build OpenCV 2.4.13 for Android on a Windows 10 x64 machine and encountered a rather puzzling error. As basis for the build process I used the following articles:


I used the following tools:

  1. Android NDK r10d
  2. CMAKE 3.6.2
  3. OpenCV 2.4.13 from trunk

My build script looks like this:

"set PATH=%PATH%;D:\XYZ\1libBuild\cmake\bin;D:\XYZ\1libBuild\AndroidNdkR10d\prebuilt\windows-x86_64\bin

cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=D:\XYZ\1libBuild\opencv2.4.13\platforms\android\android.toolchain.cmake -DANDROID_NDK=D:\XYZ\1libBuild\AndroidNdkR10d -DCMAKE_BUILD_TYPE=Release D:\XYZ\1libBuild\opencv2.4.13

cmake --build "

The building process terminates after 80% with a very ambiguous error message:

arm-linux-androideabi-g++.exe: error: isystemD:\XYZ\1libBuild\AndroidNdkR10d\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include: Invalid argument

make.exe[2]: +++ [modules\ocl\perf_precomp.hpp.gch\opencv_perf_ocl_release.gch] Error 1

make.exe[1]: +++ [modules\ocl\CMakeFiles\pch_Generate_opencv_perf_ocl.dir/all] Error 2

make.exe: +++ [all] Error 2

Please note, the "+" are "*" in the original error message. I exchanged them here, because the editor does not depict them properly.

Does anyone have similar issues during the build process or know where the error exactly comes from?

If no, could anyone please provide me with the build from OpenCV 2.4.13? It would greatly help me during my projects.

Thank you so much and have a great week!

Best regards