My own problem with gcj

Joshua R. Poulson jrp@pun.org
Wed Jun 16 14:38:00 GMT 1999


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