Linux FreeBSD共享对象问题 [英] Linux FreeBSD shared object problem

查看:115
本文介绍了Linux FreeBSD共享对象问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为freebsd构建一个应用程序,该应用程序链接到在Linux上构建的共享库"share.so".我在/usr/compat/linux/lib下也有freebsd linux兼容的库.我能够编译我的应用程序.但是在链接到"share.so"时,由于(在Linux上构建的)share.so需要访问"/usr/compat/linux/lib"下的库,我遇到了很多错误.有没有办法告诉share.so进入compat linux目录而不是/usr/lib/

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)

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

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

推荐答案

您需要修改

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

这篇关于Linux FreeBSD共享对象问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆