I am learning how to write C++ code using OpenCV and I want to run it in Android. I use Android Studio.
I have created a new simple project with C++ support and then I added my test code to the C++ file. My own files compile and link, it seems.
Now something else that I don't think is related to my project is causing many errors. It seems to be something inside NDK. Could it be a bug in the latest version, and if so, what can I do about it?
C:/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin\ld: error: C:/Android/OpenCV-android-sdk/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiCopyConstBorder_8u_C4IR_L_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
C:/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin\ld: error: C:/Android/OpenCV-android-sdk/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiConvert_32s16u_C1RSfs_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
C:/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin\ld: error: C:/Android/OpenCV-android-sdk/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiNormRel_L1_32f_C1R_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
C:/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin\ld: error: C:/Android/OpenCV-android-sdk/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiFilterBilateralBorderInit_L_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
C:/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin\ld: error: C:/Android/OpenCV-android-sdk/sdk/native/3rdparty/libs/x86/libippicv.a(jmp_icvippiScaleC_32f8u_C1R_as.s.o): relocation R_386_GOTOFF against preemptible symbol icv_ippJumpIndexForMergedLibs cannot be used when making a shared object
Instead of downgrading to NDK14 from NDK16 you can still do with NDK16 by adding following to the CMakeLists.txt
before add_library()
:
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a")
Copied from this discussion on a github issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With