0

I am using Visual Studio 2019 community version in windows. Currently cl.exe compiler is used. But i want to replace the cl.exe compiler with gcc compiler. More clearly, i want to get gcc compiled output from visual studio.

Please help me.

sepp2k
  • 363,768
  • 54
  • 674
  • 675
  • GCC is not supported by Visual Studio. You're going to have to clobber something together. – IInspectable Jun 03 '21 at 07:16
  • using Clang in MSVC would be much easier – phuclv Jun 03 '21 at 07:37
  • @phuclv Could you please explain me how to configure clang in MSVC? Via that, can i able to get gcc compiled output? – rockiee bhai Jun 03 '21 at 10:04
  • obviously not, Clang is an entirely different compiler https://devblogs.microsoft.com/cppblog/clang-llvm-support-in-visual-studio/. GCC is supported ([Use any C++ Compiler with Visual Studio](https://devblogs.microsoft.com/cppblog/use-any-c-compiler-with-visual-studio/)) but it's more difficult to configure, compared to the built-in Clang support – phuclv Jun 03 '21 at 10:15
  • Does this answer your question? [How to use GCC with Microsoft Visual Studio?](https://stackoverflow.com/questions/14768073/how-to-use-gcc-with-microsoft-visual-studio) – phuclv Jun 03 '21 at 10:16
  • Though, what is the *real* problem you are trying to solve? – IInspectable Jun 03 '21 at 16:21
  • @IInspectable , I just want to compile via gcc compiler in visual studio. – rockiee bhai Jun 04 '21 at 09:28
  • You're going to have to convince MSBuild to use GCC then. There's a pretty steep learning curve, and virtually no useful documentation available. Plus, MSBuild is all-around hostile to building native code. It's really only useful for .NET, but it is the build system integrated into Visual Studio. – IInspectable Jun 05 '21 at 10:44
  • Visual Studio is built around the MSVC compiler. But what a lot of people are doing is using MinGW-w64 GCC from Visual Studio Code. Maybe it's worth checking that out? – Brecht Sanders Jun 13 '21 at 11:27

0 Answers0