undefined references

Santosh Cheler csk4you@hotmail.com
Sun Jan 13 02:06:00 GMT 2002

> I get the following error when compiling a class:
> $gcj -I ../xerces.jar --main=Parser -o Parser Parser.java
> /tmp/cc10KIkW.o: In function 'main':
> undefined reference to 'Parser::class$'
> collect2: ld returned 1 exit status.
> Qstns:
> 1. What is the above error? how do I get rid of it?

I could get rid of this error by compiling Parser.java
and xerces.java seperately and then linking them together.
Why is this so?

> 2. Does this compile all the classes in xerces.jar and statically
>     link them in the output executable? If yes, my executable will
>     then be very big if I use large number of jar files.

seems to be yes. Can I make it link at runtime?
Also, I could get my executable size smaller by 'strip'ing it.

> 3. Can gcj be used for production, ie., is it well-tested and stable?
> thanks,
> Santosh

More information about the Java mailing list