Update: Problem with Alpha OSF1 and mips-tfile

Bryce McKinlay bryce@waitaki.otago.ac.nz
Sat Jul 21 06:51:00 GMT 2001

On Friday, July 20, 2001, at 05:59  PM, Antonio Ake wrote:

> 1. command: gcj --main=HelloWorld  -o hello HelloWorld.java
>    compiled without error messages.
>    ./hello
> 515056:./hello: /sbin/loader: Error: Unresolved symbol in
> /usr/users/ake/gcc18/lib//libgcj.so: iconv_close
> 515056:./hello: /sbin/loader: Error: Unresolved symbol in
> /usr/users/ake/gcc18/lib//libgcj.so: iconv
> 515056:./hello: /sbin/loader: Error: Unresolved symbol in
> /usr/users/ake/gcc18/lib//libgcj.so: iconv_open
> 515056:./hello: /sbin/loader: Fatal Error: this executable has
> unresolvable symbols
> Workaround: gcj --main=HelloWorld  -o hello HelloWorld.java -liconv
> Why is not linked by default -liconv? Where it could be the problem?

The file libgcj.spec (generated from libjava/libgcj.spec.in) tells the 
compiler what arguments to use when linking a java application. I guess 
we need to modify the configure script to determine when -liconv is 
required and if so add it to the generated libgcj.spec.

> 2. Problem
> I need to compile a static binary:
> Command:  gcj --main=HelloWorld  -o hello HelloWorld.java -liconv 
> -static
> Error: Undefined:
> iconv_open
> iconv_close
> iconv
> collect2: ld returned 1 exit status
> I hope this problem is related with the first one, because I really need
> to work with static binaries.

Order dependent? The -liconv may need to come before -lgcj. Try adding 
-liconv into your libgcj.spec file.



More information about the Java mailing list