使用 G++ 构建在 RedHat 版 Ubuntu 上
在 Ubuntu 上构建并使用 GCC 时,有什么方法可以链接到 RedHat 静态库吗?
Is there any way to link against RedHat static libraries while building on Ubuntu and using GCC?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将 RedHat 库和头文件复制到保留目录结构的目录,并为 GCC 提供 --sysroot 指令,告诉它在该目录中查找作为搜索库和头文件的前缀
Copy over the RedHat library and header files to a directory preserving directory structure and give GCC the --sysroot directive to tell it to look in that directory as prefix for searching libs and headers
我看到两个明显的解决方案:
第一个解决方案是最简单的,但您可能会遇到 libc 版本问题。第二种解决方案保证可以工作,但离运行完整的 RedHat 进行编译不远了。
I see two obvious solutions:
The first solution is the easiest, but you might run into libc version issues. The second solution is guaranteed to work, but not far from running a complete RedHat for compilation.