Jump to content

Which is the best C/C++ compiler?

Gat Pelsinger

I currently use Mingw-w64 with VS code. My VS code setup is crap and compilers don't work that easily. I compile through Mingw-w64 outside of the IDE, but I want to have a neat and complete IDE setup and want to compile through VS code. And as I was thinking to re-install the extensions, I was wondering which is the best C/C++ compiler? I found out that Mingw is lightweight, which I actually don't want. I want something with more power and control. And I also want to know if that recommendation is available in VS code or not. Note that it has to be 64-bit. And also, which extensions for VS code I should use will also be great. And one more thing, I remember seeing somebody use a custom terminal for the compiler. So, you don't need to install the compilers and add them to the environment variables, instead run that terminal and it should know where the compiler is instead of messing with your system PATH. I would like that as well.

 

Edit - For the VS code extensions, I would like the ones for debugging as well.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Gat Pelsinger said:

I found out that Mingw is lightweight, which I actually don't want.

Mingw is just a port of GCC to windows, if you're keen on using windows I'd say your best options are either it or MSVC (MS's compiler).

7 minutes ago, Gat Pelsinger said:

I want something with more power and control.

What do you mean by power and control? You can do pretty much anything most compilers do with it, don't think it lacks any features. Moreso, what else do you want other than compiling your C/C++ code to a binary?

7 minutes ago, Gat Pelsinger said:

And I also want to know if that recommendation is available in VS code or not.

The compiler should be agnostic to your editor, just set your toolchain properly and you should be good to go.

8 minutes ago, Gat Pelsinger said:

I remember seeing somebody use a custom terminal for the compiler. So, you don't need to install the compilers and add them to the environment variables, instead run that terminal and it should know where the compiler is instead of messing with your system PATH. I would like that as well.

Isn't that MSYS? Or maybe just WSL.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

Setting up a C/C++ toolchain on windows is more of a pain than on Linux but once it's done correctly it should work more or less equally.

 

You can also just use visual studio if you want it to be handled automatically. I don't think your complaints have anything to do with mingw being bad or worse than other compilers.

 

Still, to answer the question, it all depends on what you value in a compiler. Do you want the fastest? The one that produces the fastest binaries? The least resource hungry? The one with the clearest error messages...? It's extremely hard to come up with an objective winner and for specific use cases it will always vary. Here's a bit of a rundown of the 3 most popular C/C++ compilers: https://alibaba-cloud.medium.com/gcc-vs-clang-llvm-an-in-depth-comparison-of-c-c-compilers-a516597d5994

(Note that mingw is essentially just GCC)

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

My pick tends to be the best supported and easiest to use compiler for the system you're programming on. For Windows, that's MSVC which comes with Visual Studio (not VSCode). I do the majority of my programming on Linux and I use GCC.

 

Making the compiler create an executable that runs faster or takes up less space on disk is as simple as enabling optimizations. All the popular compilers (MSVC, GCC, and Clang) are very good at that.

Link to comment
Share on other sites

Link to post
Share on other sites

i have only ever compile c code on linux thus i have only ever use gcc. for c/c++ ide, i get clion but intellij can work as well. native support is there and nothing a few extensions from the market place can't add.

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×