【问题标题】:DMD linking fails because of missing _adCmp2 and _adEq2由于缺少 _adCmp2 和 _adEq2,DMD 链接失败
【发布时间】:2014-01-18 09:11:35
【问题描述】:

我经常在 Ubuntu 13.10 上本地重建和使用 DMD git master。昨天我的 D 工具链无法链接所有 D 程序并出现错误:

来自 DMD 的示例编译输出:

/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libphobos2.a(sections_linux_4c8_e6.o):src/rt/sections_linux.d:function 
_D2rt14sections_linux3DSO11__xopEqualsFKxS2rt14sections_linux3DSOKxS2rt14sections_linux3DSOZb: 
error: undefined reference to '_adEq2'
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libphobos2.a(sections_linux_4c8_e6.o):src/rt/sections_linux.d:function 
_D2rt14sections_linux3DSO11__xopEqualsFKxS2rt14sections_linux3DSOKxS2rt14sections_linux3DSOZb: 
error: undefined reference to '_adEq2'
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libphobos2.a(sections_linux_4c8_e6.o):src/rt/sections_linux.d:function 
_D2rt14sections_linux3DSO11__xopEqualsFKxS2rt14sections_linux3DSOKxS2rt14sections_linux3DSOZb: 
error: undefined reference to '_adEq2'
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libphobos2.a(sections_linux_4c8_e6.o):src/rt/sections_linux.d:function 
_D2rt14sections_linux3DSO11__xopEqualsFKxS2rt14sections_linux3DSOKxS2rt14sections_linux3DSOZb: 
error: undefined reference to '_adEq2'
collect2: error: ld returned 1 exit status

当我 grep 时,只有 dmd 二进制匹配这个符号,而不是 libphobos。我的 dmd 和 libphobos 都是最新的。

ld.bfdld.gold 我都试过了。

怎么了?

【问题讨论】:

  • 你也从 git 获取 druntime 吗?
  • 我通过从包含运行时和 phobos 库的 LD_LIBRARY_PATH 中删除我的 D 目录,设法让它再次工作。

标签: linker-errors d dmd phobos


【解决方案1】:

我通过从包含运行时和 phobos 库的 LD_LIBRARY_PATH 中删除我的 D 目录,设法让它再次工作。可能是我的错。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-02
    • 1970-01-01
    • 2021-01-18
    • 2014-02-25
    • 2011-12-29
    • 1970-01-01
    相关资源
    最近更新 更多