Difference between revisions of "C++"

From Blue-IT.org Wiki

(Switch different C- and C++ compilers in parallel)
Line 23: Line 23:
 
   
 
   
 
  sudo update-alternatives --config gcc
 
  sudo update-alternatives --config gcc
 +
 +
==== Further reading embeddeed ====
 +
eLinux Wiki:
 +
* http://elinux.org/Toolchains

Revision as of 21:49, 15 February 2016

Switch different C- and C++ toolchains 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

Further reading embeddeed

eLinux Wiki: