[英]Can I target older linux with newer gcc/clang? C++
Right now I compile my C++ software on a certain old version of linux (SLED 10) using the provided gcc and it can run on most newer versions as they have a newer glibc. 现在我使用提供的gcc在某个旧版本的Linux(SLED 10)上编译我的C ++软件,它可以在大多数新版本上运行,因为它们有更新的glibc。 Problem is, that old gcc doesn't support C++11 and I'd really like to use the new features.
问题是,旧的gcc不支持C ++ 11,我真的很想使用新功能。
Now I have some ideas, but I'm sure others have the same need. 现在我有一些想法,但我相信其他人也有同样的需求。 What's actually worked for you?
什么对你有用?
Ideas: 思路:
As a bonus, my software also support plugins and has an SDK. 作为奖励,我的软件也支持插件,并有一个SDK。 I'd really prefer that my customers could compile against my libraries without a huge hassle.
我真的更喜欢我的客户可以编译我的库而不会有太大的麻烦。
Thanks in advance. 提前致谢。 Ideas welcome, proven solutions preferred.
欢迎提供,经过验证的解决方案
Build with the newer gcc. 使用较新的gcc构建。 Either install the new compiler on the old machine or comile on your new machine and install the necessary dynamic libraries on the old machine.
在旧计算机上安装新编译器或在新计算机上安装新编译器,并在旧计算机上安装必要的动态库。
Note that multiple versions of libc (and also libstdc++) are supported on a single machine since they are typically versioned (ie libc.so.5, libc.so.6, etc) 请注意,单个计算机上支持多个版本的libc(以及libstdc ++),因为它们通常是版本化的(即libc.so.5,libc.so.6等)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.