Install GCC with C++14 support on Ubuntu/Mint

The current GCC in the ubuntu repository doesn’t support the C++14 standard. To use the C++14 install the GCC has to be updated manually. It can be found in the Ubuntu Toolchain PPA. After this, the C++ compiler can be updated. The following commands show how to add the repository and install the compiler:

After the installation, the compiler can be used by this command:

The default compiler will not be updated. You can see this, because the g++ symlink points to the old g++ version:

To set g++4.9 as default compiler, the symlink in has to be updated:

To check if you are now using the right compiler you can print the gcc version. It should be something like 4.9.X.

That’s all. Source code can now be comiled like this:

About Marco Scholtyssek

Studied technical computer science at FH Dortmund and works as a software developer for embedded systems.
This entry was posted in linux. Bookmark the permalink.

3 Responses to Install GCC with C++14 support on Ubuntu/Mint

  1. Arun says:

    Amazing, I followed several links, this was one of the best, that could bring me out from the disaster.
    Thanks Macro..

  2. Hema says:

    Thank you very much

Leave a Reply

Your email address will not be published. Required fields are marked *