Ask Your Question

Error building Opencv 2.4.13 for Android with CMAKE

asked 2016-09-12 02:25:46 -0500

Conundraah gravatar image

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


edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2016-09-23 01:37:29 -0500

Conundraah gravatar image

Sorry, I had a lot to do in the past week. I found the problem and managed to compile OpenCV 4 Andorid. It seems like there was a problem with the OpenCL module. After excluding it from the build process it worked without further problems.

Best regards


edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-09-12 02:25:46 -0500

Seen: 268 times

Last updated: Sep 23 '16