我正在编译OpenCV以在具有核心模块的android中使用,因为应用程序的大小增加了,但仅在armeabi-v7a架构中编译才成功。
所有其他架构,例如x86,MIPS,arm64-v8a等,都给出了一些不同的错误。我的ndk是r16b,我测试了r18b和r14b,但没有用。
x86体系结构中的错误:ANDROID_ABI = x86
[ 49%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
[ 49%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Iex/IexBaseExc.cpp.o
[ 49%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Iex/IexThrowErrnoExc.cpp.o
[ 49%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfAcesFile.cpp.o
In file included from G:\android-data\android-ndk-r16b\sources\cxx-stl\gnu-libstdc++\4.9\include/random:50:0,
from G:\android-data\android-ndk-r16b\sources\cxx-stl\gnu-libstdc++\4.9\include/bits/stl_algo.h:66,
from G:\android-data\android-ndk-r16b\sources\cxx-stl\gnu-libstdc++\4.9\include/algorithm:62,
from G:\opencv-4.0.1\3rdparty\openexr\IlmImf\ImfAcesFile.cpp:45:
G:\android-data\android-ndk-r16b\sources\cxx-stl\gnu-libstdc++\4.9\libs\x86\include/bits/opt_random.h:33:23: fatal error: x86intrin.h: No such file or directory
#include <x86intrin.h>
^
compilation terminated.
3rdparty\openexr\CMakeFiles\IlmImf.dir\build.make:100: recipe for target '3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfAcesFile.cpp.o' failed
mingw32-make.exe[2]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfAcesFile.cpp.o] Error 1
CMakeFiles\Makefile2:460: recipe for target '3rdparty/openexr/CMakeFiles/IlmImf.dir/all' failed
mingw32-make.exe[1]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2