My own problem with gcj
Brent Fulgham
bfulgham@xpsystems.com
Wed Jun 16 14:43:00 GMT 1999
Title: RE: My own problem with gcj
Isn't this just the fact that your class has
no main() routine for an entry point?
Java from Sun's JDK would choke on this, too,
because all you have here is a class.ÃÂ There
is no entry point.
Try adding a main() to your program.
> -----Original Message-----
> From: Joshua R. Poulson [ mailto:jrp@pun.org ]
> Sent: Wednesday, June 16, 1999 2:38 PM
> To: java-discuss@sourceware.cygnus.com
> Subject: My own problem with gcj
>
>
> Mine's worse. I have your code:
>
>ÃÂ ÃÂ ÃÂ public class Example {
>ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ public static void
>ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ main(String[] args)
>ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ {
>ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ System.out.println("Hello World");
>ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ }
>
>ÃÂ ÃÂ ÃÂ }
>
> And I can compile a class file, and even a .o file, but for
> for an executable
> and I get this:
>
> $ gcj Example.java
> /u/jrp/SunOS/lib/gcc-lib/sparc-sun-solaris2.6/gcc-2.95/crt1.o:
>ÃÂ In function
> `nope':
> /u/jrp/SunOS/lib/gcc-lib/sparc-sun-solaris2.6/gcc-2.95/crt1.o(
> .text+0x5c):
> undefined reference to `main'
> collect2: ld returned 1 exit status
>
> $ gcj -c Example.java
> $ gcj Example.o
> /u/jrp/SunOS/lib/gcc-lib/sparc-sun-solaris2.6/gcc-2.95/crt1.o:
>ÃÂ In function
> `nope':
> /u/jrp/SunOS/lib/gcc-lib/sparc-sun-solaris2.6/gcc-2.95/crt1.o(
> .text+0x5c):
> undefined reference to `main'
>
> This probably is a FAQ, but I haven't found the answer.
>
> --jrp
>
>
More information about the Java
mailing list