This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: compile error
- From: Andrew Haley <aph at redhat dot com>
- To: <martin_aliger at email dot cz>
- Cc: <java at gcc dot gnu dot org>
- Date: Wed, 6 Nov 2002 17:38:38 +0000 (GMT)
- Subject: Re: compile error
- References: <3DC9511E.000001.08022@email1.atc.cz>
Martin Aliger writes:
> -----
> package org.apache.poi.poifs.dev;
>
> public class POIFSViewer
> {
>
> public static void main(final String args[])
> {
> }
> }
> -----
>
> > Please show use *exactly* the commands that you use to compile this
> > file and the resulting compiler output.
> >
> > Andrew.
>
> Here it is: [I'm more interested in compile into binary but maybe they are related]
>
> [alik@explorer poic]$ gcj --version
> gcj (GCC) 3.2
> Copyright (C) 2002 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> [alik@explorer poic]$ gcj --main=POIFSViewer POIFSViewer.java
> /tmp/cckLFs3o.o: In function `main':
> /tmp/cckLFs3o.o(.text+0x1d): undefined reference to `POIFSViewer::class$'
> collect2: ld returned 1 exit status
In your '--main=' you did not include the package name:
~ > gcj org/apache/poi/poifs/dev/POIFSViewer.java --main=org.apache.poi.poifs.dev.POIFSViewer
~ > ./a.out
~ >
> [alik@explorer poic]$ gcj -C POIFSViewer.java
> [alik@explorer poic]$ gij POIFSViewer
~ > gcj -C org/apache/poi/poifs/dev/POIFSViewer.java
~ > gij org.apache.poi.poifs.dev.POIFSViewer
~ >
Andrew.