代码之家  ›  专栏  ›  技术社区  ›  Asher postmodern

Dyld:延迟符号绑定失败:找不到符号-找到NM报告符号

  •  2
  • Asher postmodern  · 技术社区  · 15 年前

    这是一个相当抽象的问题,因为我不知道从哪里开始我自己的调查。

    我有一个用cmake构建的C包,它生成librpdb.so;我为同一个库设置了一个Ruby gem,它生成rpdb.bundle。

    在Ruby中使用时,我会得到:

    dyld: lazy symbol binding failed: Symbol not found: _RPDB_RuntimeStorageController_sharedInstance
      Referenced from: /usr/local/lib/ruby/gems/1.9.1/gems/rpdb-0.1.0/lib/rpdb/rpdb.bundle
      Expected in: flat namespace
    

    当我查看图书馆时,NM报告:

    000000000000ea40 T _RPDB_RuntimeStorageController_sharedInstance
    

    因此,这个符号似乎确实在库中。那么,为什么绑定会失败呢?

    1 回复  |  直到 15 年前
        1
  •  2
  •   Community CDub    8 年前

    简单地说,链接并不是在第一个库的级别上发生的,尽管它没有报告那么多,因为头是正确找到的。

    More details regarding why this was occurring for my circumstances, here

    and also, here