Re: Unable to compile java file with gcj 4.1.1: undefined reference to main

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephen Torri writes:
 > I am having trouble building a java file with gcj. If I attempt to build
 > it from the obfuscated class file (a.class) I get the error message:
 > 
 > storri@base$ gcj a.class
 > /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../crt1.o: In function `_start':
 > init.c:(.text+0x18): undefined reference to `main'
 > collect2: ld returned 1 exit status
 > 
 > So I though okay I will let gcj reading the straight Java source file. I
 > get the same error message. Given the source file below is there any
 > reason why GCJ cannot compile it?

Works for me:

zorro:~ $ gcj Fibonacci.java --main=Fibonacci
zorro:~ $ ./a.out 6
Calculated fibonacci number: 8
Calculated fibonacci number: 5
Calculated fibonacci number: 3
Calculated fibonacci number: 2
Calculated fibonacci number: 1
Calculated fibonacci number: 1
Calculated fibonacci number: 0

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux