关于linux的二进制兼容性 [英] About the binary compatiblity of linux

查看:333
本文介绍了关于linux的二进制兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我得到一些C ++代码构建,让我们说,Ubuntu上的GCC 4.8,代码没有GUI /接口,只调用标准linux libaries,然后可以在RHEL 5/6上运行二进制,与更旧的GCC完美?

If I get some C++ code built by, lets say, GCC 4.8 on Ubuntu, the code has no GUI/interface, only call standard linux libaries, then can the binary run on RHEL 5/6, with much older GCC flawlessly?

推荐答案

通常不能。它会抱怨libc太老了,一个。

Normally it can't. It will complain about libc being too old, for one.

如果你静态链接libstdc ++,并小心避免新的glibc功能,你可以逃脱它。后者并不总是可能的。使用libc的静态链接不受官方支持,可能会为您工作或不工作。

If you statically link with libstdc++ and carefully avoid newer glibc features, you may be able to get away with it. The latter is not always possible though. Static linking with libc is not officially supported and may work or not work for you.

这篇关于关于linux的二进制兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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