couldn't link successfully when i use ndk-build to complile my opencv code on android platform

asked 2014-04-15 07:28:56 -0600

reply2010 gravatar image

updated 2014-04-15 20:31:14 -0600

hi, i use ndk-build to compile my opencv code for android.I have successful experience on the work.but,today i fail to success.this is my log under ndk-build:

In function 'CameraWrapperConnector::getPathLibFolder()': camera_activity.cpp:
undefined reference to 'dladdr' 
collect2: ld returned 1 exit status /cygdrive/d/android-ndk-r4-crystax/build/core/ 
recipe for target '/cygdrive/e/EclipseSomkeDetect/obj/local/armeabi/' failed
make: *** [/cygdrive/e/EclipseSomkeDetect/obj/local/armeabi/] Error 1

could any expert tell me what is problem?several weeks ago,i compile opencv code successfully which include no cvcapture func .My current c++ code uses cvcapture func and could not link successfully.any message would be appreciated. someone tells you should add app_platform:=android-8 in,i try,but i fail.

edit retag flag offensive close merge delete


What I would suggest first: please use the latest NDK (r9d), the latest OpenCV4Android SDK (2.4.8 or even coming soon 2.4.9) and don't use Cygwin. Start from here:

Andrey Pavlenko gravatar imageAndrey Pavlenko ( 2014-04-15 09:41:17 -0600 )edit

thanks a lot.i follow your suggestion.i can success.but i find new problem.when i use my .so lib in eclipse android project,my run result: java.lang.ExceptionInInitializerError ...... Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1936]: 85 could not load needed library '' .... i search on google,someone tells add OPENCV_LIB_TYPE:=STATIC in try in static library mode.but i get errors in ndk-build as below: "Compile++ thumb : SmokeDetect <= SmokeDetect.cpp SharedLibrary : ... error: undefined reference to 'std::istream::seekg(std::fpos<mbstate ... any comment? thanks

reply2010 gravatar imagereply2010 ( 2014-04-17 01:58:20 -0600 )edit