Best c++ compiler

Hello everybody!
Which c++ compiler is the best?
"Best" is a relative term. What are you looking for? High generated code quality? Support for obscure instruction sets? Options to not generate code using remotely obscure instruction sets? Cross-compilation ability? Quick compile times?

Even then, it's not a clear-cut "this compiler is better" answer, as that depends on situation to situation. Compilers are very complex pieces of code (at least the good ones are).

Generally, you can't go wrong with Microsoft's C++ compiler (although that one I have some gripes with due to it supporting anti-standard code), clang, or g++. Those are kind of like the big three.

-Albatross
Last edited on
1. Cross-compilation for some my tasks.
2. Must work on bare metal to make some utilities and I would like to make OS.
Last edited on
Code::Blocks is a good one. Not sure if it does what you asked.
If you want to make an OS...
1) Why?
2) Do you realize the enormity of the task?
3) C++ is probably not the language to do it.
closed account (Dy7SLyTq)
Code::Blocks
code blocks is an ide no a compiler

C++ is probably not the language to do it.

as long as you have assembly you can use c++ too. but you cant do it just in c++
You could do it in pure C++, it just would require some hackery and possibly designing your own compiler toolset.
closed account (Dy7SLyTq)
alright let me rephrase. you cant do it with pure c++ using well established compilers such as gcc or vc++. there might be other reasons, but the only one i can think of off the top of my head is c++ cant handle the interrupts that come so you need assembly for that
Thank you Albatross and other people!
Also, I would like to find out, which compiler to use with Oracle 11
1. in Windows 7
2. in SUSE Linux Enterprise Server 11 (x86_64)
if you want to make your own OS for x86/x64 use intel compiler or amd compiler.

@DTSCode - c++ is containing C - of course it can handle interrupts. In OS programming you only need to use assembler to set start address for the boot-loader.

C++ is not good for low-level OS programming because in bare metal CPU there is no new or delete keywords - you need to implement them yourself to use dynamic allocation, etc.. Just use C for kernel and drivers then use cpp for higher levels.
Last edited on
closed account (Dy7SLyTq)
c++ is containing C
not completely true
of course it can handle interrupts.
no it cant. we are thinking of two different interrupts. im not talking about ctrl+c. http://en.wikibooks.org/wiki/X86_Assembly/X86_Interrupts

C++ is not good for low-level OS programming because in bare metal CPU there is no new or delete keywords - you need to implement them yourself to use dynamic allocation
you can use new and delete with c++ and still have it work fine with assembly code. you dont need to implement anything

http://wiki.osdev.org/Interrupt_Service_Routines
you can use new and delete with c++ and still have it work fine with assembly code. you dont need to implement anything
i based my answer on http://www.brokenthorn.com/Resources/OSDevMSVC.html (Developing a C++ Runtime Envirement for MSVC++).

no it cant.
this was my bad. I mixed typical mcu architecture interrupt handling with x86 which is using instruction to access interrupts.
closed account (Dy7SLyTq)
http://www.drpaulcarter.com/pcasm/pcasm-book-pdf.zip go to the c++ section in the back
Thanks a lot.
Is it possible to use Open Watcom C++ to make OS?
Topic archived. No new replies allowed.