0

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?

  • your edit basically changes the question you asked. mark this one as resolved and open another one. likely on a different site. – myusuf3 Feb 05 '14 at 15:38

1 Answers1

1

You are likely compiling everything yourself. if you are 'unskilled' (I don't think so, just new) ubuntu user I would highly suggest the deb maintainers do the hard work for you.

so check to see if apt-get has a copy which you want to use by searching like so.

aptitude search clang

if it does great it will handle things, if not you can download tar ball here

Extact it to /usr/local or /opt from there you can use it and delete the entire folder if you wish without any affects on your system.

Goodluck.

myusuf3
  • 34,189