suggested FAQ

Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
Fri May 16 11:07:00 GMT 2003


I didn't notice an update to the GCJ FAQ since your mail, so I'm hereby
forwarding this to our java mailing list.

Thanks for the feedback!

Gerald

On Thu, 8 May 2003, Anthony Bucci wrote:
> I have a suggested question/answer for the gcj FAQ.  I have seen variants of
> this same question come up again and again on newsgroups, and I believe it's
> because of the same point of confusion.
>
> --------
>
> Q.  I am trying to compile a Java class Test in package foo, and I get
> "undefined reference to 'Test::class$'" errors.  Help!
>
> A. You are not including the fully-qualified class name in the --main switch
> to gcj.  For class Test in package foo, the following command will result in
> an error:
>
> > gcj -o Test --main=Test foo/Test.java
> /tmp/cc2d4YQr.o: In function ain':
> /tmp/cc2d4YQr.o(.text+0x2b): undefined reference to est::class$'
>
> The correct way to compile this class is to issue:
>
> > gcj -o Test --main=foo.Test foo/Test.java
> > ./Test
> Hello world
>
> This is similar to how you'd do the same with javac and java:
>
> > javac foo/Test.java
> > java foo.Test
> Hello world
>
> -------
>
> Sincerely,
>
> Anthony Bucci
>

-- 
Gerald "Jerry"   pfeifer@dbai.tuwien.ac.at   http://www.pfeifer.com/gerald/



More information about the Java mailing list