系统相关
首页 > 系统相关> > Linux FreeBSD共享对象问题

Linux FreeBSD共享对象问题

作者:互联网

我正在尝试为freebsd构建一个应用程序,该应用程序链接到在Linux上构建的共享库“ share.so”.我还在/usr/compat / linux / lib下有与freebsd linux兼容的库.我能够编译我的应用程序.但是,当链接到“ share.so”时,我遇到了很多错误,因为share.so(基于linux构建)需要访问“ /usr/compat / linux / lib”下的库.有没有办法告诉share.so进入compat linux目录而不是/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)

这些是我得到的警告.这些版本在compat / linux / lib中可用,因为/usr/lib包含较低版本.这是sharedlib.so是在Linux上生成的.so文件

解决方法:

您需要修改loader configuration才能告诉它在该目录中查找库.

标签:linker,freebsd,shared-libraries,linker-errors,linux
来源: https://codeday.me/bug/20191210/2100284.html