I am struggling already a few hours with the problem of calling cv::imdecode()
in my native code for Android using the prebuild libraries of the OpenCV 2.3.1.
Here is what I am trying to do. I have library that detects for now QR code in the image BarcodesLibrary
which is built as a static library. And then I have written some wrappers for JNI which ensures the conversion between Java/C++ objects - these modules are packaged into shared library JNI_QRBarcodesLibrary
and the BarcodesLibrary
is also linked into it.
And now become the errors showed in this dump. Errors relate to the inserting highgui
module and calling imdecode()
. Just have to mention yet that everything compiles fine and libraries are sucessfully imported to the android without imdecode()
.
"Compile++ thumb : JNI_QRBarcodesLibrary <= JNI_QRBarcodesLibrary.cpp
"Compile++ thumb : JNI_QRBarcodesLibrary <= jDetectedMark.cpp
"Compile++ thumb : JNI_QRBarcodesLibrary <= jImage.cpp
"Compile++ thumb : JNI_QRBarcodesLibrary <= JNIWrapper.cpp
"Compile++ thumb : JNI_QRBarcodesLibrary <= jPoint.cpp
"Compile++ thumb : JNI_QRBarcodesLibrary <= jSize.cpp
"Compile++ thumb : BarcodesLibrary <= Image.cpp
"Compile++ thumb : BarcodesLibrary <= Barcode.cpp
"Compile++ thumb : BarcodesLibrary <= QrBarcode.cpp
Prebuilt : libopencv_contrib.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_calib3d.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_objdetect.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_features2d.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_video.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_imgproc.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_highgui.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_ml.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_legacy.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_flann.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libopencv_core.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : lib3rdparty_libjpeg.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : lib3rdparty_libpng.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : lib3rdparty_libtiff.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : lib3rdparty_libjasper.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : lib3rdparty_zlib.a <= ../OpenCV/libs/Android/armeabi/
Prebuilt : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/armeabi
StaticLibrary : libBarcodesLibrary.a
SharedLibrary : libJNI_QRBarcodesLibrary.so
And the build ends with this error:
./obj/local/armeabi/libopencv_highgui.a(grfmt_pxm.o):(.data.rel.ro+0x0): undefined reference to `vtable for __cxxabiv1::__enum_type_info'
./obj/local/armeabi/libopencv_highgui.a(bitstrm.o):(.data.rel.ro+0x0): undefined reference to `vtable for __cxxabiv1::__enum_type_info'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libJNI_QRBarcodesLibrary.so] Error 1
Well I was expecting that not all features inside this library will be supported while this library provides the OS dependent imshow, waitKey etc. But that it will be problem with the imdecode
is what I was not counted with.
So do you have any ideas how to solve this problem or any other libraries that can be ported to Android and provide image decoding - especially JPEG format?
I am grateful for any tips. Thanks.