我用java写了一个纸牌的游戏,用javac编译成功,运行也正确,为什么用gcj编译就不行呢
程序有点长,就不写出来了,只把错误写出来
[afei@localhost card]$ gcj CardDeck.java
/usr/lib/crt1.o(.text+0x1: In function `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
/tmp/ccDrlpk8.o(.text+0x61: In function `CardDeck::__U3c_clinit__U3e_()':
: undefined reference to `Card::class$'
/tmp/ccDrlpk8.o(.text+0x692): In function `CardDeck::__U3c_clinit__U3e_()':
: undefined reference to `Card::class$'
/tmp/ccDrlpk8.o(.text+0x6af): In function `CardDeck::__U3c_clinit__U3e_()':
: undefined reference to `Card::Card(int, int)'
collect2: ld returned 1 exit status
后面我又写了个小的Hello.java实验程序:
public class Hello{
public static void main(String args[]){
System.out.println("Hello,Java!");
}
}
这小程序总没错吧,克为什么还是编译错误
[afei@localhost afei]$ gcj Hello.java
/usr/lib/crt1.o(.text+0x1: In function `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
collect2: ld returned 1 exit status
郁闷
请各位大侠指教