dyld: lazy symbol binding failed: Symbol not found - nm reports symbol found

旧时模样 提交于 2020-01-30 06:40:25

问题


Fairly abstract question here, as I don't know quite where to start my own investigations.

I have a C package constructed with CMake that produces librpdb.so; I have a Ruby Gem set up for the same library, which produces rpdb.bundle.

When used in Ruby, I get this:

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

When I look into the library, nm reports:

000000000000ea40 T _RPDB_RuntimeStorageController_sharedInstance

So it appears that the symbol is indeed in the library. Why, then, would binding fail?


回答1:


Simply put, linking wasn't occurring at the level of the first library, although it wasn't reporting as much because the headers were found appropriately.

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

and also, here



来源:https://stackoverflow.com/questions/3315987/dyld-lazy-symbol-binding-failed-symbol-not-found-nm-reports-symbol-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!