Update g++ but still old version

Installing a newer (or older) version of GCC than the Ubuntu default version via the package manager does not delete the default version. You get both. You can install as many versions as you like. gcc/g++ will continue to run the default version. If you have installed GCC 7, then you run the new compilers with gcc-7 or g++-7. For most build systems, it is sufficient to set the environment variables CC=gcc-7 CXX=g++-7 before starting the build.

Leave a Comment