Re: undefined reference to when using gcj



vlenin66 schrieb:
Hi,

However, when I try to compile it using gcj, I get this:
~/NetBeansProjects/JavaApplication2/src$ gcj --main=Main
javaapplication2/Main.java -o Main
/tmp/ccqiWhM6.o: In function `main':
cc2ARovz.i:(.text+0x1d): undefined reference to `Main::class$$'
collect2: ld returned 1 exit status
How about "gcj --main=javaapplication2.Main javaapplication2/Main.java -o Main"?
You need to fully specify the class, including package.
.



Relevant Pages

  • g77-3.4, ubuntu 7.10
    ... sudo apt-get install g77-3.4 ... But when I try to compile this is what I get ... collect2: ld returned 1 exit status ...
    (Ubuntu)
  • Re: Undefined reference to main
    ... : undefined reference to `main' ... collect2: ld returned 1 exit status ... This happens whether I compile the code using a makefile or normally ...
    (comp.os.linux.development.apps)
  • Microchip PIC porgrammer
    ... gpsim won't compile on my machine: ... collect2: ld returned 1 exit status ...
    (comp.os.linux.misc)
  • dyld_stub_binding_helper undefined symbol / crt1.o link error
    ... I am trying to compile on Mac OS X 10.4 my C program. ... link phase where I get (gcc 4.01): ... collect2: ld returned 1 exit status ...
    (comp.lang.c)
  • Problems with G++ - Undefined symbol: .
    ... but I can't compile a hello world program. ... collect2: ld returned 8 exit status ... Is 4.0.0 the best version of g++ (I found it on the AIX linux tool kit). ...
    (comp.unix.aix)