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: "Compile++ thumb : SmokeDetect <= SmokeDetect.cpp SharedLibrary : libSmokeDetect.so 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 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="" 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="" collect2:="" ld="" returned="" 1="" exit="" status="" make:="" <em="">* [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 04-17 13:34:44.614: E/AndroidRuntime(3148): FATAL EXCEPTION: main 04-17 13:34:44.614: E/AndroidRuntime(3148): java.lang.ExceptionInInitializerError 04-17 13:34:44.614: E/AndroidRuntime(3148): at lxj.a20.smokedetect.SmokedetectActivity.onCreate
(SmokedetectActivity.java:12) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.app.Activity.performCreate(Activity.java:4465) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.app.Instrumentation.callActivityOnCreate
(Instrumentation.java:1049) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.app.ActivityThread.access$600(ActivityThread.java:122) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.os.Handler.dispatchMessage(Handler.java:99) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.os.Looper.loop(Looper.java:137) 04-17 13:34:44.614: E/AndroidRuntime(3148): at android.app.ActivityThread.main(ActivityThread.java:4340) 04-17 13:34:44.614: E/AndroidRuntime(3148): at java.lang.reflect.Method.invokeNative(Native Method) 04-17 13:34:44.614: E/AndroidRuntime(3148): at java.lang.reflect.Method.invoke(Method.java:511) 04-17 13:34:44.614: E/AndroidRuntime(3148): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:784) 04-17 13:34:44.614: E/AndroidRuntime(3148): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 04-17 13:34:44.614: E/AndroidRuntime(3148): at dalvik.system.NativeStart.main(Native Method) 04-17 13:34:44.614: E/AndroidRuntime(3148): 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) 04-17 13:34:44.614: E/AndroidRuntime(3148): at java.lang.Runtime.loadLibrary(Runtime.java:370) 04-17 13:34:44.614: E/AndroidRuntime(3148): at java.lang.System.loadLibrary(System.java:535) 04-17 13:34:44.614: E/AndroidRuntime(3148): at lxj.a20.smokedetect.LibSmokeDetect.<clinit>(LibSmokeDetect.java:5) 04-17 13:34:44.614: E/AndroidRuntime(3148): ... 15 more
could not find libopencv_java.so
how can i resolve it?any light would be appreciated.thanks any comment.