Can I force visual studio to use mingw compiler

19,499

Solution 1

You can't easily replace the C++ compiler in Visual Studio.

But at one time (in the 1990's) I used Visual Studio as simply an editor for Java. And since there are extensions for e.g. the D programming language (well that's the only one I've used) you can certainly, with a lot of work, make the full Visual Studio work with g++ or any other compiler for whatever language, as an additional "language". It can even work with the debugger, if the language implementation is suitable for that.

It's just that nowadays it's much easier to use an IDE that does support the tools you want to use. E.g., for g++ you have Eclipse, Code::Blocks, even old DevC++, etc. Oh yes, and the QT thing.

Solution 2

Just set up a makefile project - that way you can tell VC what command to run to compile your files.

You have to maintain a makefile in addition to the Visual Studio project, but that's really not too big of a problem since in that case the VS project becomes just a list of the files you want Visual Studio to know about.

Unfortunately, the VS debugger is not useful in this scenario, but all of the IDE's code navigation works fine.

Share:
19,499
Juriy
Author by

Juriy

Updated on June 20, 2022

Comments

  • Juriy
    Juriy about 2 years

    I don't like qt creator as IDE and love VS, but I must use exactly mingw compiler. Sad story :'(