first of all I want to tell you what I want to do. I have a .h-file and a .c-file with usual C-Code in it with which I created a shared library with the Android NDK. So now I have a .so-file which is called libtry.so. Furthermore, I want to use native code in my Android Eclipse project. So I created .java-file with the class "Counter" and the content
public native static int Number(int n);
and
static
{
System.loadLibrary("test");
}
Then I create a C-header file from the .java-file with the javah tool.
Afterwards I create a C-sourcefile for the C-Headerfile in which I implement the native code.
Then I create a shared library with those two files with LOCAL_MODULE := test
, so that the file will be named libtest.so
. But the point is, that I want to link the shared library libtry.so, which I created at the beginning, to this shared library.
So in the Android.mk-file of libtest.so I put LOCAL_LDLIBS := -L/root/Android/Samples/Test/libs/ -ltry
.
Actually this works because I can compile this Android.mk-file with ndk-build.
But now in my Eclipse project, if I want to use the library libtest.so it does not work. I mean If I create an object of the Class "Counter" in which the library libtest.so is loaded,
I get the error: "Cannot load library: link_image[1966]: 1752 could not load needed library 'libtry.so' for 'libtest.so'"
.
What am I doing wrong? Thanks in advance.