thanks for the make file,
now i am getting another problem , a little bit strange
~/docs/jni/jniexamples/chap2/HelloWorld$
gcc -I/usr/local/share/jdk1.5.0_05/include
-I/usr/local/share/jdk1.5.0_05/include/linux HelloWorld.c
/usr/lib/gcc/i486-linux-gnu/4.0.2/../../../../lib/crt1.o: In function
`_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
the program is the HelloWorld application the Sun Tutorials.
Because you didn't tell the compiler you wanted a shared library it
tried to compile a program, which needs a main().
Compile your code like this:
gcc -fPIC -D_REENTRANT
-I $JAVA_HOME/include
-I $JAVA_HOME/include/linux
-c HelloWorld.c
Then link the shared library like this:
gcc -shared HelloWorld.o -o libhello.so
Or compile and link with a single command:
gcc -fPIC -shared -D_REENTRANT
-I $JAVA_HOME/include
-I $JAVA_HOME/include/linux
HelloWorld.c
-o libhello.so
(note that each command should be a single line)
/gordon