Difference between revisions of "C++"

From Blue-IT.org Wiki

(Using different C- and C++ compilers in parallel)
(Switch different C- and C++ compilers in parallel)
Line 8: Line 8:
  
 
A solution is pointed out here:
 
A solution is pointed out here:
* > USED HERE > http://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-4-9-on-ubuntu-14-04
+
* > '''SOLUTION USED HERE''' > http://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-4-9-on-ubuntu-14-04
 
* http://askubuntu.com/questions/26498/choose-gcc-and-g-version
 
* http://askubuntu.com/questions/26498/choose-gcc-and-g-version
  

Revision as of 21:46, 15 February 2016

Switch different C- and C++ compilers in parallel

I have to mention: I don't like working with C++. I know very well, it is one "mother" of all object oriented programming languages (despite there are others, like LISP). Also their exist very good toolchains and frameworks for C++ like QT (> 4). And it has it's place in a lot of big and serious software products, kernel development, ... but: I think it will be overcome with time due to a lot of facts - especially when it comes developing user applications. The arguments I wrote down in my bachelor thesis many years ago ...

If you have to deal with C++ in Ubuntu there are some caveats. One of them is to use different C/C++-Compiler versions in parallel within one Ubuntu distribution.

See:

A solution is pointed out here:

This boils down to (thanks muru)

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

sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9

sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

sudo update-alternatives --config gcc