GCC worth using on Windows to replace MSVC?

前端 未结 7 774
礼貌的吻别
礼貌的吻别 2021-01-29 21:44

I currently develop in C++ on Windows, using Visual Studio 2010. After the official announcement of C++11, I have begun to use some of its features that are already available in

7条回答
  •  野的像风
    2021-01-29 22:25

    GCC's C++11 support is quite phenomenal (and quite up to par with standards conformance, now that has been implemented).

    If you replace your compiler, you'll need to make sure every dependency can be built with that new compiler. They're not made to be substitutable plugins (although Clang is working on becoming that way).

    GCC is a fine compiler, and can produce code that has pretty much the same performance, if not better, than MSVC. It is missing some low-level Windows-specific features though.

    Apart from this, to answer your questions:

    1. To get VS to use GCC as a compiler, you'd pretty much need to turn to makefiles or custom build steps all the way. You'd be much better off compiling from the commandline and using CMake or something similar.
    2. You cannot use the VS debugger for GCC code. GCC outputs GDB compatible debug information, and the VS debug format is proprietary, so nothing will change in that area anytime soon.
    3. Code quality is just as good as you'd want it. See above.
    4. No, the quality of your code will actually increase, as GCC will point out several assumed standard extensions MSVC would hide from you. All self-respecting open source projects can be compiled with GCC.

提交回复
热议问题