Vscode-cpptools: Need to know if its better to use GCC or MSVC-x64

Created on 16 Dec 2019  路  4Comments  路  Source: microsoft/vscode-cpptools

I dont know which is better, if one is better than the other.
For intellisense and compiler.

Should I be using msvc-x64
which points to:
"C:/program Files (86)/Microsoft Visual Studio/2019/community/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe"
or
"C:/Mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe"

Is there a benefit of one over the other and why?

Thank you :D

Language Service question

Most helpful comment

These days there are few differences between compilers (MSVC, GCC, Clang/LLVM). It's hard to say why one compiler would be better than the others.

Personally I like GCC and Clang/LLVM more because of better portability for Linux or MacOS for example, and that I personally think that both GCC and Clang/LLVM give better diagnostic messages about warning or errors.
However, both GCC and Clang/LLVM both require runtime libraries that users don't have unless they either install MinGW-GCC or Clang/LLVM (or you distribute the runtime libraries with your programs). MSVC doesn't suffer from this obviously.

I've only gotten into a small amount of situations where MSVC had some trouble compiling correctly, but those were very specific to begin with and might've been fixed by now.

One key difference you might or might not experience is what is supported of the C++ standard library by each compiler. Compilers continuously get updates extending standard library support, so I'd just check out https://en.cppreference.com/w/cpp/compiler_support to see what is currently supported by each compiler

As for IntelliSense in VSCode with this extension... I've never really noticed much difference in performance and information between compilers, so you can choose whatever you feel like honestly.

All 4 comments

These days there are few differences between compilers (MSVC, GCC, Clang/LLVM). It's hard to say why one compiler would be better than the others.

Personally I like GCC and Clang/LLVM more because of better portability for Linux or MacOS for example, and that I personally think that both GCC and Clang/LLVM give better diagnostic messages about warning or errors.
However, both GCC and Clang/LLVM both require runtime libraries that users don't have unless they either install MinGW-GCC or Clang/LLVM (or you distribute the runtime libraries with your programs). MSVC doesn't suffer from this obviously.

I've only gotten into a small amount of situations where MSVC had some trouble compiling correctly, but those were very specific to begin with and might've been fixed by now.

One key difference you might or might not experience is what is supported of the C++ standard library by each compiler. Compilers continuously get updates extending standard library support, so I'd just check out https://en.cppreference.com/w/cpp/compiler_support to see what is currently supported by each compiler

As for IntelliSense in VSCode with this extension... I've never really noticed much difference in performance and information between compilers, so you can choose whatever you feel like honestly.

Thank you for taking the time out to explain this information.
Its very appreciated :)

You should use the intelliSenseMode that matches what your code was written to compile against (or the mode that gives less buggy squiggles if the compile compiles with multiple compilers).

The cl.exe compiler is developed by Microsoft and only runs on Windows platforms, while gcc/clang-based compilers will run on Linux/Mac.

If you're starting a new project, you could have multiple configurations and try to build with both compilers to compare the results (e.g. we compile our stuff with both cl.exe and clang).

This issue has been closed automatically because it's labeled as a 'question' and has not had recent activity.

Was this page helpful?
0 / 5 - 0 ratings