1
votes

I am trying to create an .so library, containing OpenCV C++ code. I set up something very basic - using visual studio to build the project, with the "Dynamic shared library (Android)" template.

I downloaded the Android OpenCV SDK from here: https://opencv.org/releases/

When I build the project for ARM, everything runs fine and I get a lib.so output. But when building for ARM64, I get the following error:

E0035 #error directive: This constructor has not been ported to this platform File: C:\Microsoft\AndroidNDK64\android-ndk-r16b\sources\cxx-stl\llvm-libc++\include\bitset (line 266)

Here is how I set the project properties:

ARM and ARM64:

Properties -> C/C++ -> Additional include directories = <openCV android sdk folder>\sdk\native\jni\include

ARM:

Properties -> Linker -> General -> Additional library directories = <openCV android sdk folder>\sdk\native\libs\armeabi-v7a

Properties -> Linker -> Input-> Additional dependencies = <openCV android sdk folder>\sdk\native\libs\armeabi-v7a\libopencv_java4.so

ARM64:

Properties -> Linker -> General -> Additional library directories = <openCV android sdk folder>\sdk\native\libs\arm64-v8a

Properties -> Linker -> Input-> Additional dependencies = <openCV android sdk folder>\sdk\native\libs\arm64-v8a\libopencv_java4.so

I am able to get the exact same error when building for ARM if I am targeting an android API lower than 21.

Any idea on how to fix the problem?

1

1 Answers

0
votes

I had the same issue, decided to download the OpenCV Android SDK https://github.com/opencv/opencv/releases/tag/4.4.0 and used NDK instead of compiling the source