I am an unskilled Ubuntu user and almost each time I try to install something nontrivial I break something miserably. I am successfully using gcc 4.7 and 4.8 simultaneously using update-alternatives according to this answer. Now I would like to try out clang for my C++ development.
I am afraid that the complier is a critical part of the operating system and installing it is nontrivial. I am afraid that if install clang it will overwrite the C++ standard headers and libraries of gcc and/or break something else.
How can I safely install and use clang and gcc?
EDIT:
I do not have aptitude installed, so I tried:
sudo apt-get install clang-3.4
instead and everything looks fine. I tested gcc and it seems that I did not break it.
Then I tried to compile something with clang and I got this error:
/usr/include/c++/4.8/iostream:38: error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
^
It seems that clang is trying to use the gcc standard library. How can I solve this?