sudo apt-get install python-software-propertiesNow the tool chain repository can be added with these commands:
sudo add-apt-repository ppa:ubuntu-toolchain-r/testWith this repository, the current GCC 4.6.3 can be upgraded to the most recent of the 4.6 series to 4.6.4. However, the goal is to get a more recent version. For this the g++-4.8 package needs to be installed:
sudo apt-get update
sudo apt-get install g++-4.8This should also bring the other required packages (gcc-4.8-base, gcc-4.8, cpp-4.8 and libstdc++-4.8-dev). Once the 4.8 packages are installed, they need to be selected, otherwise the 4.6 commands will still be executed. This is accomplished with the following commands:
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
For the first time, the first two commands are not needed. I put these lines into a script file (named usegcc48), and created and second script identical to this except with the "4.8" changed to "4.6" to select the 4.6 commands (named usegcc46). This way, it is easy to switch between the two versions (the execute bit needs to set on these scripts using the command chmod +x usegcc4*).
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)