Hi...
> The beginning of the name also matters. That call will expect to load a
> library named "libtest_lib.so". Other requirements: build the sources
> with the "-fpic" flag, and link the library with the "-shared" flag.
Thanks! About 5 minutes ago, I tried the lib prefix and it worked (I mean,
the bloody thing did find the library! Too much mimicking of Solaris!)
Apologies to Steve, who already suggested doing so, but I overlooked this
particular part of his comments.
Now I get another error which I 'm sure has to do with my naive use of gcc.
More specifically, I have a simple program, test.c, which implements a very
basic "Hello World"-type native method. I compile the program using
gcc -I $JDK12_HOME/include -I $JDK12_HOME/include/linux -fpic test.c
<path1>/object1.o <path2>/object2.o -o test
and it produces the necessary executable output. Now, to get the shared
library, I do it all in one pass, like
gcc -I $JDK12_HOME/include -I $JDK12_HOME/include/linux -fpic -shared test.c
<path1>/object1.o <path2>/object2.o -o libtest.so
Now, the Java program does run, but when I try to call the native method
contained in test.c, I get an UnsatisfiedLinkError. Am I doing something
wrong with the compilation process of the native library, libtest.so?
Thanks,
Dimitris
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]