How to Check the Version of my gcc?

The symlink to the 4.8.2 directory is nothing to worry about, it’s normal for the libstdc++ headers on Red Hat Enterprise Linux (and therefore CentOS) to be arranged like that.

gcc --version will tell you the version of the gcc executable in your path.

rpm -q libstdc++-devel will tell you the version of the package that owns the C++ standard library headers.

rpm -ql libstdc++-devel will list the files installed by that package, which will include the files under /usr/include/c++/4.8.2

rpm --verify libstdc++-devel will check that you haven’t messed up the C++ headers by replacing them with something else.

The error is more concerning, that implies you have messed something up. My guess would be it’s in the from [...omitted by myself as it is irrelevant] part, which may actually be very relevant. std::locale should be declared in <bits/locale_classes.h> which is included before <bits/locale_facets_nonio.h>, so if it wasn’t declared my guess is that you have some header that defines _LOCALE_CLASSES_H and prevents the standard library header from being read. Do not define include guards that start with underscores, they are reserved names.

Leave a Comment