2607
2607

Reputation: 4115

How to install C++11 C++0x header files on Redhat Enterprise

I moved my application to another Linux box, after compilation, it returns an error saying

#include <atomic> 

can not be resolved.

I guess the new GNU C++11 header files / libraries are not installed on new machine.

My question is how can I install them?

I am running on Redhat Enterprise, so yum install ?

Thanks.

Upvotes: 4

Views: 8845

Answers (3)

Dave Johansen
Dave Johansen

Reputation: 926

The include under the version of gcc that comes with RHEL 6 is:

#include <cstdatomic>

See Runtime Library (libstdc++) section of gcc 4.4 releaste notes.

EDIT: This answer is not fully correct, because cstdatomic is the C11 file and not the C++11 one. For full C++ support in RHEL 6, the devtoolset should be used.

Upvotes: 1

Nemo
Nemo

Reputation: 71555

The Red Hat Developer Toolset provides C++11 support.

(Indeed, I suspect this is the primary reason for its existence.)

Upvotes: 8

Billy ONeal
Billy ONeal

Reputation: 106589

Looks like you'll need to install an up to date version of GCC yourself; RHEL (at least as of 6.x) does not have a version of GCC supporting C++0x in it's repositories. You can build recent versions of GCC by following GCC's installation instructions, which are distribution-neutral.

You may also be able to use a package from a more recent Fedora release, which generally contains more "bleeding edge" software than that available in RHEL.

Upvotes: 0

Related Questions