cant find libopencv_java.so when run and cant compile static library and cvnamewindow error

asked 2014-04-17 02:09:10 -0600

reply2010 gravatar image

updated 2014-04-17 02:46:18 -0600

hi,expert i use OpenCV-2.4.8-android-sdk and android-ndk-r8-crystax-1 to build my .so lib for android project.when i compile in non-static mode,i can success.however,when i compile in static mode that is add OPENCV_LIB_TYPE:=STATIC in android.mk i find errors as follow:

D:/android-ndk-r8-crystax-1/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux /ld.exe: ../../../sdk/native/jni/../3rdparty/libs/armeabi/libIlmImf.a(ImfStdIO.cpp.o): in function Imf::St t._ZN3Imf11StdIFStream5seekgEy+0x16): error: undefined reference to 'std::istream::seekg(std::fpos<mbstate< p="">

D:/android-ndk-r8-crystax-1/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux /ld.exe: ../../../sdk/native/jni/../3rdparty/libs/armeabi/libIlmImf.a(ImfStdIO.cpp.o): in function Imf::St t._ZN3Imf11StdOSStream5seekpEy+0x18): error: undefined reference to 'std::ostream::seekp(std::fpos<mbstate< p="">

D:/android-ndk-r8-crystax-1/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux /ld.exe: ../../../sdk/native/jni/../3rdparty/libs/armeabi/libIlmImf.a(ImfStdIO.cpp.o): in function Imf::St t._ZN3Imf11StdOFStream5seekpEy+0x16): error: undefined reference to 'std::ostream::seekp(std::fpos<mbstate< p="">

collect2: ld returned 1 exit status make: * [D:/OpenCV-2.4.8-android-sdk/samples/smokedetect//obj/local/armeabi/libSmokeDetect.so] Error 1

if i use non-static mode,i can get my libSmokeDetect.so successfully.but i use .so in eclipse.when i run in my hardware ,i get errors:

java.lang.ExceptionInInitializerError ... Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1936]: 85 could not load needed library 'libopencv_java.so' for 'libSmokeDetect.so' (load_library[1091]: Library 'libopencv_java.so' not found) .....

could not find libopencv_java.so

at last ,i add System.loadLibrary("opencv_java"); in my java file.and copy libopencv_java.so into libs of android project.i can pass above error,but a new error as below: OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /home/reports/ci/slave_desktop/50-SDK/opencv/modules/highgui/src/window.cpp, line 483

is there bugs in opencv2.4.8?why are there many errors when compile,link in opencv sdk? i work in windows and use opencv2.4.8 android sdk released from opencv.org.why need recompile.how to recompile in windows.i don't know why offical release is unavailable? how can i resolve it?any light would be appreciated.thanks any comment.

edit retag flag offensive close merge delete

Comments

1

maybe i can shed some light on the last one: "Unspecified error (The function is not implemented".

you're trying to call imshow() or namedWindow() - which are not supported on android ( we can't open native windows there)

berak gravatar imageberak ( 2014-04-17 03:01:19 -0600 )edit

thanks berak.there are some code like cvNamedWindow("xxx",1); in my cpp.your means we could not use cvNamedWindow in native mode?thans again.

reply2010 gravatar imagereply2010 ( 2014-04-17 03:34:52 -0600 )edit

exactly. you can't use it.

berak gravatar imageberak ( 2014-04-17 03:36:30 -0600 )edit