Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use multiple versions of GCC

Tags:

c++

linux

gcc

g++

We have a new application that requires glibc 2.4 (from gcc 4.1). The machine we have runs on has gcc 3.4.6. We can not upgrade, and the application must be run on this machine.

We installed gcc 4.1, however, when it comes to compile time it is using all the includes, etc, from 3.4.6.

How do we get around this?

Any suggestions on using 4.1 for just this application?

like image 584
Alex Avatar asked Jan 15 '09 21:01

Alex


People also ask

Does GCC 11 support C ++ 17?

C++17 Support in GCCThis mode is the default in GCC 11; it can be explicitly selected with the -std=c++17 command-line flag, or -std=gnu++17 to enable GNU extensions as well.

Does GCC 4.8 support C ++ 17?

According to cppreference, full support of c++11 came with gcc 4.8. 1; To have full support of c++14 (with some of the new features of c++17), instead, you need gcc 5.0 and above.


2 Answers

Refer "How to install multiple versions of GCC" here in the GNU GCC FAQ.

There's also a white paper here.

like image 125
rbrayb Avatar answered Sep 24 '22 15:09

rbrayb


for Ubuntu it's pretty easy

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update

and then install for example gcc version 6

sudo apt-get install gcc-6

like image 26
i716 Avatar answered Sep 20 '22 15:09

i716