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

I moved my application to another Linux block after compilation, it returns an error message

#include <atomic> 

cannot be allowed.

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

My question is, how can I install them?

I work for Redhat Enterprise, so yum install?

Thanks.

+4
source share
3 answers

Red Hat Developer Toolset supports C ++ 11.

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

+8
source

The included version of gcc that ships with RHEL 6 is:

 #include <cstdatomic> 

See the Runtime Library (libstdc ++) section in gcc 4.4. Release notes .

EDIT: this answer is not entirely correct, because cstdatomic is a C11 file, not a C ++ 11. For full C ++ support, devtoolset should be used in RHEL 6.

+1
source

It looks like you will need to install the latest version of GCC yourself; RHEL (at least from 6.x) does not have a GCC version that supports C ++ 0x in its repositories. You can create the latest versions of GCC by following the GCC installation instructions , which are distribution neutral.

You can also use the package from a newer version of Fedora , which typically contains more bleeding edge software than in RHEL.

0
source

Source: https://habr.com/ru/post/1402736/


All Articles