(C++) GetGccVersion
February 24, 2017 · View on GitHub
(C++) GetGccVersion
GetGccVersion is a version code snippets to obtain the version of the current GCC in use.
//#include <cstdlib> #include <string> #include <boost/lexical_cast.hpp> ///GetGccVersion returns the version number of GCC currently installed. ///From http://www.richelbilderbeek.nl/CppGetGccVersion.htm const std::string GetGccVersion() { return boost::lexical_cast<std::string>(__GNUC__) + std::string(".") + boost::lexical_cast<std::string>(__GNUC_MINOR__) + std::string(".") + boost::lexical_cast<std::string>(__GNUC_PATCHLEVEL__); }