Difference between revisions of "C++"

From Blue-IT.org Wiki

(Created page with "== Using different 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 languag...")
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Using different C-compilers in parallel ==
+
== 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 ...
+
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). C and C++ take a major rule in embedded software development. And it has it's place in a lot of big and serious software projects, kernel development, ... but: I think it will be overcome with time due to a lot of facts I won't explain here - 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.
 
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.
Line 8: Line 8:
  
 
A solution is pointed out here:
 
A solution is pointed out 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
  
 
This boils down to (thanks [http://askubuntu.com/a/581497/15917 muru])
 
This boils down to (thanks [http://askubuntu.com/a/581497/15917 muru])
Line 14: Line 15:
 
  sudo add-apt-repository ppa:ubuntu-toolchain-r/test
 
  sudo add-apt-repository ppa:ubuntu-toolchain-r/test
 
  sudo apt-get update
 
  sudo apt-get update
 +
 
  sudo apt-get install gcc-4.9 g++-4.9
 
  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 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 embedded linux ====
 +
eLinux Wiki:
 +
* http://elinux.org/Toolchains

Latest revision as of 21:51, 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). C and C++ take a major rule in embedded software development. And it has it's place in a lot of big and serious software projects, kernel development, ... but: I think it will be overcome with time due to a lot of facts I won't explain here - 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 embedded linux

eLinux Wiki: