Compiler options for creating a *.so from *.c in linux

hello,

I have written a simple jni program as explained in the java tutorial.

I works fine on Windows NT, but whan i try to compile and run it on redhat linux 7.0, i get a UnsatisfiedLinkError.

I think i am going wrong while i am creating the *.so object.

I have set the java.library.path system property, so that the jvm can find the .so file.

Can anyone pls tell me the exact procedure to compile a *.c file to *.so file in redhat linux 7.0.

thanks in advance,

steve

[537 byte] By [stephen_edward] at [2007-9-26 1:57:09]
# 1
First compile as library: gcc -s -O2 -shared blabla.c -o blabla.sothen: export LD_LIBRARY_PATH=/the/folder/where/your/lib/is/placed
v.pavlov at 2007-6-29 3:13:22 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
thanks it works fine.
stephen_edward at 2007-6-29 3:13:22 > top of Java-index,Java HotSpot Virtual Machine,Specifications...