【问题标题】:can't compile jar with gcj: undefined reference to main无法使用 gcj 编译 jar:未定义对 main 的引用
【发布时间】:2013-01-09 19:49:38
【问题描述】:

我使用 eclipse 开发了我的 java 项目并构建了一个可运行的 jar。 然后我尝试使用 gcj 来编译那个 jar。

stefan@api-1:/Sbox/Software/executables$ gcj --classpath=Sbo
xSpeakerDependent.jar --main=SboxInterface SboxSpeakerDependent.jar -o Test
/tmp/ccpTssYV.o: In function `main':
ccIqdepF.i:(.text+0x24): undefined reference to `SboxInterface::class$'
collect2: ld gab 1 als Ende-Status zurück

但是 SboxInterface 是唯一具有主方法的类,我也在 eclipse 中创建可运行的 jar 时放置了这些信息。

我可以尝试什么?我有点不知所措。

【问题讨论】:

标签: gcj


【解决方案1】:

确保该类在 jar 中,并且您将完全限定的类名传递给 --main。这是两个最常见的错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-16
    • 1970-01-01
    • 2013-05-13
    • 2015-08-25
    • 2020-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多