Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(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__);
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict