Linux FreeBSD shared object problem

谁说胖子不能爱 提交于 2019-12-12 14:14:34

问题


I am trying to build an application for freebsd which links to a shared object "share.so" built on linux. I also have freebsd linux compatible libraries under /usr/compat/linux/lib. I am able to compile my application. But while linking to "share.so" I am getting bunch of errors as share.so(built on linux) needs to access libraries under "/usr/compat/linux/lib". Is there a way to tell share.so to look into compat linux directory instead of /usr/lib/

/usr/bin/ld: warning: libstdc++.so.6, needed by sharedlib.so, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libm.so.6, needed by sharedlib.so, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libgcc_s.so.1, needed by sharedlib.so, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libpthread.so.0, needed by sharedlib.so, not found (try using -rpath or -rpath-link)

These are the warnings I am getting. These versions are available in compat/linux/lib where as the /usr/lib contains lower versions. Here sharedlib.so is the .so files generated on linux


回答1:


You need to modify your loader configuration to tell it to look in that directory for libraries.



来源:https://stackoverflow.com/questions/2322221/linux-freebsd-shared-object-problem

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