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

Student of technical computer science at FH Dortmund, works as software developer at itemis AG in Lünen.
This entry was posted in linux. Bookmark the permalink.

4 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. bitboss41 says:

    i followed the instructions you posted. however after the update, any command referring to g++-4.9 it’s saying command not found …. i even tried running it again…not luck can you help??

Leave a Reply

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