Ask Your Question
3

OpenCV 2.4.11 NDK arm64-v8a x86_64

asked 2015-05-05 16:19:25 -0600

sviborg gravatar image

Hi,

I'm working on shared lib that uses static OpenCV and works perfect under 32-bit ARM's. But have a lot of unresolved symbols when building for APP_ABI arm64-v8a and x86_64.

Looks like the 64-bit OpenCV libs compiled with wrong flags, or some weird toolchain issue (because armeabi armeabi-v7a mips x86 works OK). Any ideas?

arm64-v8a configure log: http://www.everfall.com/paste/id.php?...

arm64-v8a build log: http://www.everfall.com/paste/id.php?...

Short x86_64 error log:

ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::pyrDown(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int> const&, int)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::getStructuringElement(int, cv::Size_<int>, cv::Point_<int>)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::morphologyEx(cv::_InputArray const&, cv::_OutputArray const&, int, cv::_InputArray const&, cv::Point_<int>, int, int, cv::Scalar_<double> const&)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::getStructuringElement(int, cv::Size_<int>, cv::Point_<int>)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::morphologyEx(cv::_InputArray const&, cv::_OutputArray const&, int, cv::_InputArray const&, cv::Point_<int>, int, int, cv::Scalar_<double> const&)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::getStructuringElement(int, cv::Size_<int>, cv::Point_<int>)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::morphologyEx(cv::_InputArray const&, cv::_OutputArray const&, int, cv::_InputArray const&, cv::Point_<int>, int, int, cv::Scalar_<double> const&)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'cv::bitwise_and(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&)'
ccmkDP4c.ltrans10.ltrans.o:ccmkDP4c.ltrans10.o:function PickAnalyzer::DetectSlots(): error: undefined reference to 'vtable for cv::_OutputArray'

[Application.mk]

APP_PLATFORM := android-21
APP_ABI := arm64-v8a
APP_STL := gnustl_static
APP_CPPFLAGS += -std=c++11 -frtti -fexceptions

[Android.mk]

MY_INCLUDE_FILES := -I./ -I$(LOCAL_PATH)/../ -I$(LOCAL_PATH)/include/
MY_CFLAGS := -O3 -Ofast -flto -DANDROID_NDK -DNDEBUG
MY_LDLIBS := -lm -ldl -lz -llog -landroid
MY_STL_LIB := gnustl_static

include $(CLEAR_VARS)
LOCAL_MODULE := mylib
LOCAL_CFLAGS := $(MY_CFLAGS) $(MY_INCLUDE_FILES)
LOCAL_LDLIBS := $(MY_LDLIBS)

LOCAL_SRC_FILES := ...

LOCAL_STATIC_LIBRARIES := opencv_core opencv_ml opencv_flann opencv_imgproc opencv_highgui opencv_features2d

include $(BUILD_SHARED_LIBRARY)

[OpenCV prebuild libs]

include $(CLEAR_VARS)
LOCAL_MODULE    := opencv_core
LOCAL_SRC_FILES := libs_static/$(TARGET_ARCH_ABI)/libopencv_core.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := opencv_ml
LOCAL_SRC_FILES := libs_static/$(TARGET_ARCH_ABI)/libopencv_ml.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := opencv_flann
LOCAL_SRC_FILES := libs_static/$(TARGET_ARCH_ABI)/libopencv_flann.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := opencv_imgproc
LOCAL_SRC_FILES := libs_static/$(TARGET_ARCH_ABI)/libopencv_imgproc ...
(more)
edit retag flag offensive close merge delete

Comments

There is no precompiled 64 bit libraries for Android yet. You can try to build them by yourself.

mshabunin gravatar imagemshabunin ( 2015-05-06 08:33:11 -0600 )edit

How can I get to compile 64 bit libraries for Android?

blueveil gravatar imageblueveil ( 2015-06-02 01:08:49 -0600 )edit

Something like:

cmake \
../opencv \
-DCMAKE_TOOLCHAIN_FILE=../opencv/platforms/android/android.toolchain.cmake \
-DANDROID_ABI="x86_64" \
-DWITH_TBB=ON \
-DINSTALL_ANDROID_EXAMPLES=ON \
-DANDROID_NATIVE_API_LEVEL=9
make -j4
mshabunin gravatar imagemshabunin ( 2015-06-02 05:17:26 -0600 )edit

Hello, did you succeed in building this 64bit library? I also need it for 64bit devices and 2.4* version of OpenCV

user12551 gravatar imageuser12551 ( 2017-03-12 04:36:53 -0600 )edit

Who did complied the opencv with ffmpeg for android arm64-v8a? I need it also.... Need help

JohnnyWang gravatar imageJohnnyWang ( 2018-12-10 06:14:40 -0600 )edit

@JohnnyWang , please do not post answers here, if you have a question or comment, thank you.

berak gravatar imageberak ( 2018-12-10 06:16:37 -0600 )edit

I am new to this forum. I am sorry~

JohnnyWang gravatar imageJohnnyWang ( 2018-12-10 19:33:31 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-12-16 03:49:21 -0600

Android JNI prebuilts and build instructions can be found on github: https://github.com/wgsystems/OpenCV-p...

edit flag offensive delete link more

Comments

please note, that as of 2019, the 2.4 branch is entirely dead, and probably noone should use it.

(you made some nice effort, but please use a more recent codebase !)

berak gravatar imageberak ( 2019-12-16 04:08:24 -0600 )edit
1

I do, this is only for compatibility reasons. I do not recommend anyone still to use 2.4.

wgsystems_pjacobs gravatar imagewgsystems_pjacobs ( 2019-12-16 05:14:18 -0600 )edit

Question Tools

4 followers

Stats

Asked: 2015-05-05 15:47:11 -0600

Seen: 4,641 times

Last updated: Dec 10 '18