Problem with static linking

Bryce McKinlay bryce@albatross.co.nz
Tue Mar 13 19:38:00 GMT 2001


Jeff Morrow wrote:

> OK, here's what I did.  I compiled with -g and ran.  On the compiling
> machine, it all worked just fine.  When I transferred the binary to
> another machine and ran it, I got the following:

Looks like a glibc incompatibility? Even with static linking you have to
make sure that iconv stuff is of the right version - I think it gets
dynamically loaded? So you should make sure that the "other" machine has
the same glibc as your compiling machine.

If you want to create a good portable binary, I recommend statically
linking libgcj, but dynamically linking glibc, linuxthreads, etc. That way
the installed glibc version shouldn't matter quite as much.

regards

  [ bryce ]




More information about the Java mailing list