the best compiler for c++ in ubuntu

i've just installed ubuntu 10.10 on my laptop.but i don't know the best compiler for c++.
any suggestions????
...
also,if there's a link,please give it to me!
thanks.
sudo apt-get install build-essentials
... and that will install g++ (The GCC C++ compiler) and a lot of other useful tools.
"Best" is subjective.

GCC is good, but some proprietary compilers might do something "better", e.g. Intel's compiler can optimize for Intel processors a bit more, but has other limitations. Clang is said to have neat errors.
Clang's errors are more informative (and colorful) than GCC's, especially with templates. Trying to read the same error messages with GCC is a nightmare. Also, clang is generally a front-runner with new C++ features - they're already implementing things from the standard after C++14.

http://clang.llvm.org/diagnostics.html
http://clang.llvm.org/cxx_status.html
Last edited on
sudo apt-get install build-essential clang
I think Clang is waaaay better than gcc.
There is a reason why Apple's Xcode IDE moved to Clang from gcc in OS X 10.7 or 10.8 maybe.
There is a better C++1y support in clang than gcc.

You should try both and see yourself which one is better.

EDIT: Clang is better than gcc and MSVC.
Last edited on
The best will probably be the Intel compiler. But GCC will do.

Just because Apple moved to CLang, doesn't mean it's better than GCC. They're probably just after LLVM for unencumbered multi-arch requirement. That's why FreeBSD uses it.
Last edited on
it is very easy to install a free software in ubuntu just go to the ubuntu software center type which software u want and click on install button the software will get install automatically just u have to connect to the net and g++ is gud in ubuntu for c++ programs
Why did you install such an old version of Ubuntu?
Guessing it either came with a book or something. Shouldn't be too hard to upgrade from 10.10 to 14.04 though.
Topic archived. No new replies allowed.