error in builing from source for android

asked 2019-03-16 06:15:58 -0500

i have encountered an error while building opencv 4.0.1 from source to use it in android studio. After making source files using CMake and i get this error while using MinGw

[ 0%] Building C object 3rdparty/cpufeatures/CMakeFiles/libcpufeatures.dir/cpu-features.c.o In file included from E:\libraries\opencv_source\opencv-4.0.1\3rdparty\cpufeatures\cpu-features.c:64:0: E:\libraries\opencv_source\opencv-4.0.1\3rdparty\cpufeatures\cpu-features.h:31:23: fatal error: sys/cdefs.h: No such file or directory #include <sys cdefs.h=""> ^ compilation terminated. 3rdparty\cpufeatures\CMakeFiles\libcpufeatures.dir\build.make:61: recipe for target '3rdparty/cpufeatures/CMakeFiles/libcpufeatures.dir/cpu-features.c.o' failed mingw32-make[2]: * [3rdparty/cpufeatures/CMakeFiles/libcpufeatures.dir/cpu-features.c.o] Error 1 CMakeFiles\Makefile2:230: recipe for target '3rdparty/cpufeatures/CMakeFiles/libcpufeatures.dir/all' failed mingw32-make[1]: [3rdparty/cpufeatures/CMakeFiles/libcpufeatures.dir/all] Error 2 Makefile:161: recipe for target 'all' failed mingw32-make: ** [all] Error 2

edit retag flag offensive close merge delete


hi there, the current error output is unfortunately not very useful.

seing the output from cmake would be good here (to see, which ndk toolchain is involved, etc).

could you add it to the question ? (we'll sure help with the formating !)

berak gravatar imageberak ( 2019-03-16 09:59:11 -0500 )edit