Chen-Lung Wu,

I forund that I needed to do several steps to compile c code and make a
shared library. Here is what I did:
(for HelloWorld example)

files HelloWorld.java, HelloWorldImp.c, Main.java
1. run javac on HelloWorld.java, and javah on this
(as instruced in the example)

2. compile the C code with gcc

gcc -fPIC -I/usr/local/java/include -I/usr/local/java/include/genunix -c
HelloWorldImp.c

gcc -shared -W1,-soname,libhello.so.1 -o libhello.so.1.0 HelloWorldImp.o

create the links to the library with version numbers:

ln -s libhello.so.1.0 libhello.so.1
ln -s libhello.so.1 libhello.so


information from the linux gcc HOWTO file.

Hope this helps.

Laurel Watts

-- 
Laurel A. Watts
NIST 838.01
325 Broadway
Boulder, CO 80303

(303) 497-7418


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to