2
我想爲android構建OpenCV 3.2。當我嘗試爲armeabi-v7a配置構建它時,我沒有編譯它的問題。然而,當我試圖編譯它的arm64-V8A硬件我收到以下消息:構建OpenCV for Android的錯誤arm64-v8a
/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/signal.h:87:12: error: expected ')'
void (*sa_sigaction)(int, struct siginfo*, void*);
^
/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/asm/signal.h:102:24: note: expanded from macro 'sa_sigaction'
#define sa_sigaction _u._sa_sigaction
^
/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/signal.h:87:10: note: to match this '('
void (*sa_sigaction)(int, struct siginfo*, void*);
^
/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/signal.h:87:12: error: duplicate member '_u'
void (*sa_sigaction)(int, struct siginfo*, void*);
^
/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/asm/signal.h:102:22: note: expanded from macro 'sa_sigaction'
#define sa_sigaction _u._sa_sigaction
^
/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/signal.h:86:18: note: previous declaration is here
sighandler_t sa_handler;
^
/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/asm/signal.h:101:20: note: expanded from macro 'sa_handler'
#define sa_handler _u._sa_handler
這是CMake的是如何配置:
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_TOOLCHAIN -DANDROID_NDK=$NDK_ROOT -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=21 -DCMAKE_INSTALL_PREFIX=~/opencv/arm64 -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TIFF=false -DTIFF_LIBRARY=$TIFF_LIBRARY -DTIFF_INCLUDE_DIR=$TIFF_INCLUDE_DIR -DBUILD_OPENEXR=false
有沒有其他人遇到這個問題?現在我已經掙扎了兩天了。任何幫助將不勝感激。
編輯:我注意到,CMake的。OUPUTS這一行:
Target: Android 21 armv7-a
即使我設置的ABI arm64-V8A。任何想法爲什麼?
嘗試[this](https://github.com/skanti/Android-Manual-Build-Command-Line)。在開始設置時有點困難,但一旦完成,它基本上是沒有Java UI **的普通'C++'編碼**。 –
所有這些路徑都是arm32頭文件,而不是arm64頭文件。您的構建配置有問題。 –