/Michael
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.
>
In my application, I build libchm.so with the JNI. and after generated
libchm.so file, I put the file in the data/data/<project_folder>/lib
still it cant load from the lib.
Here is my steps for building .so file
1. Create a java file in which I call native method of my JNI.
2. After it, complie with javah and make .h header file.
3. And then in my project I make couple of .mk file 1. Android.mk and
2. Application.mk
4. Then i create .c file for my native method implementation (which is
use libchm.so file for methods).
5. Then compile it with make APP=<project_name> from the root of the
my ANDROID_NDK directory.
And build libchm.so file and this file I put in project/lib. But, at
the running time the libchm.so library cant load.
And I also put needed .so files in NDK/platform/arm-embi/usr/lib but
still the problem arise.
This is my Android.mk file,
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test_demo
LOCAL_SRC_FILES := test_demo.c chm_lib.h
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog -lchm
include $(BUILD_SHARED_LIBRARY)
I dont know, what happened?
Thnx..
/Michael
03-26 04:37:40.085: INFO/dalvikvm(552): Unable to dlopen(/data/data/com.example.FileLoaderActivity/lib/libfileloader.so): Cannot load library: link_image[1698]: 30 could not load needed library 'libchm.so.0' for 'libfileloader.so' (load_library[1039]: Library 'libchm.so.0' not found)
As per your suggestion, I go through the .so.0 file. but machine find
the library at the run time from the system/lib directory.
And I cant put the my .so file in the system/lib directory (Error :
Read only file system).
so how can I put .so file in system/lib directory.
or if any other solution for dynamic load library at the run time.
Thnx in advance.
Joyy
/Michael
The best choice is to link to chm library statically.
If you have to link dynamically, your native library won't load in
Android 1.5 due to a bug in OS (but there's at least one workaround I
know about).