the best compiler for c++ in ubuntu

Aug 20, 2014 at 4:00pm
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.
Aug 20, 2014 at 4:26pm
sudo apt-get install build-essentials
Aug 21, 2014 at 9:29am
... and that will install g++ (The GCC C++ compiler) and a lot of other useful tools.
Aug 21, 2014 at 10:53am
"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.
Aug 21, 2014 at 11:04am
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 Aug 21, 2014 at 11:06am
Aug 21, 2014 at 12:51pm
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 Aug 21, 2014 at 12:51pm
Aug 22, 2014 at 3:13am
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 Aug 22, 2014 at 3:17am
Aug 22, 2014 at 8:36am
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
Aug 22, 2014 at 5:10pm
Why did you install such an old version of Ubuntu?
Aug 22, 2014 at 7:05pm
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.