drv13270
2016-11-25 09:01
浏览 69

C / C ++可以将所有动态库构建到一个bin文件中吗?

When I develop across different OS's I find that a program built on one Linux system can not be run on another system, due to the different libc version.

How can I build in all the shared libraries just like golang did in c/c++?

Including libc and libcxx

图片转代码服务由CSDN问答提供 功能建议

当我跨不同的操作系统进行开发时,我发现在一个Linux系统上构建的程序无法在另一个系统上运行, 由于libc版本不同。

如何像golang在c / c ++中那样在所有共享库中进行构建?

包括libc和 libcxx

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dqifn68206 2016-11-25 12:39
    已采纳

    If you want to run on multiple Linux systems, all you really need is to build using the oldest glibc from any of them. The easiest way is to simply download a virtual machine image from an old system like CentOS 5 and build there. You don't need to worry about static linking, just building against an old version will mean you are mostly compatible with newer versions.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题