trouble compiling app w/ jni

stewart@neuron.com stewart@neuron.com
Sat Apr 14 00:19:00 GMT 2001


I'm new to gcj, but not to java. I've got some simple java-only apps working
and now I'm trying to get a couple working that depend on jni native
methods. These are already working with Sun's 1.2.2, 1.3.0 and IBM's 1.3.0.
gcj successfully builds the .class and I've gotten the shared lib compiled
but when I try to build a stand-alone executable with:

 gcj --main=foo -o foo foo.class syscall.class

I get at lot of:

/local/uml/opt/sys/syscall.class(.data+0xac): undefined reference to
`syscall::sync(void)'
/local/uml/opt/sys/syscall.class(.data+0xbc): undefined reference to
`syscall::getpid(void)'
/local/uml/opt/sys/syscall.class(.data+0xcc): undefined reference to
`syscall::getuid(void)'
/local/uml/opt/sys/syscall.class(.data+0xdc): undefined reference to
`syscall::setuid(int)'
/local/uml/opt/sys/syscall.class(.data+0xec): undefined reference to
`syscall::gethostname(void)'
/local/uml/opt/sys/syscall.class(.data+0xfc): undefined reference to
`syscall::sethostname(java::lang::String *)'
/local/uml/opt/sys/syscall.class(.data+0x10c): undefined reference to
`syscall::halt(void)'
...

and the LD_LIBRARY_PATH is set correctly. foo.class is dependent on
syscall.class which contains native methods and uses libsyscall.so
(sucessfully compiled).

thanks for any help,

stewart





More information about the Java mailing list