1

I am a newbie to C++ compilation in production environment I wonder if there are any issues in running a C++11 executable compiled with gcc4.7 ( on debian 6 ) on a computer with an older gcc version, an older glibc / libstdc++.

Thanks

EDIT :

I want to add more details to my question ( maybe it's better to open a new question ? )

I need to compile a legacy C++ code with new libs in C++11

  • on debian 7 ( for gcc 4.7 ) and run the exe on debian 6
  • on fedora 18 ( for gcc 4.7 ) and run the exe on centos 6

How to achieve this ?

4

1 回答 1

2

这确实取决于系统,但总的来说,对于 libc,应该没有任何真正的问题,除非您使用的是最近才添加的一些特殊功能。libc 的设计目标之一是始终保持兼容。

libstdc++ 是另一回事,我强烈建议静态链接它(-static-libstdc++)。

于 2013-06-17T15:55:40.047 回答