LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 812|回复: 2

gcc的java编译器不能用?

[复制链接]
发表于 2004-11-24 12:03:51 | 显示全部楼层 |阅读模式
新装的RH9带有gcc的java支持,但是连helloWorld都通不过,错误如下:

/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18): In function
`_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
/tmp/ccmJsb2Y.o(.text+0xf): In function `test::main(JArray<java::lang::String*>*)
':
: undefined reference to `_Jv_InitClass'
/tmp/ccmJsb2Y.o(.text+0x18): In function `test::main(JArray<java::lang::String*>*
)':
: undefined reference to `java::lang::System::class$'
/tmp/ccmJsb2Y.o(.text+0x2d): In function `test::main(JArray<java::lang::String*>*
)':
: undefined reference to `java::lang::System::class$'
/tmp/ccmJsb2Y.o(.text+0x32): In function `test::main(JArray<java::lang::String*>*)':
: undefined reference to `_Jv_InitClass'
/tmp/ccmJsb2Y.o(.text+0x3e): In function `test::main(JArray<java::lang::String*>*)':
: undefined reference to `java::lang::System:ut'
/tmp/ccmJsb2Y.o(.text+0x68): In function `test::test[in-charge]()':
: undefined reference to `java::lang::Object::Object[in-charge]()'
/tmp/ccmJsb2Y.o(.data+0x50): undefined reference to `java::lang::Object::finalize()'
/tmp/ccmJsb2Y.o(.data+0x54): undefined reference to `java::lang::Object::hashCode()'
/tmp/ccmJsb2Y.o(.data+0x58): undefined reference to `java::lang::Object::equals(java::lang::Object*)'
/tmp/ccmJsb2Y.o(.data+0x5c): undefined reference to `java::lang::Object::toString()'
/tmp/ccmJsb2Y.o(.data+0x60): undefined reference to `java::lang::Object::clone()'
/tmp/ccmJsb2Y.o(.data+0x80): undefined reference to `vtable for java::lang::Class'
/tmp/ccmJsb2Y.o(.data+0x94): undefined reference to `java::lang::Object::class$'
/tmp/ccmJsb2Y.o(.eh_frame+0x11): undefined reference to `__gcj_personality_v0'
collect2: ld returned 1 exit status

难道必须用JDK?
望各位指教!
发表于 2004-11-24 12:26:17 | 显示全部楼层
从上面的信息,似乎gcc根本没有将你的java源文件识别出来,而还是作为c文件编译的。
我没有试过用gcc编译java,是不是需要用什么参数??
发表于 2004-11-25 10:54:34 | 显示全部楼层

gcj命令好像是

gcj
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表