GCC worth using on Windows to replace MSVC?

2020-05-11 05:36发布

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 MSVC. But, as expected, the great majority of the new changes are not supported.

I thought maybe the upcoming version of Visual Studio would add these new features. However, after reading this it looks like very little is going to change.

And so, I'm curious about the feasibility of using GCC on Windows rather than MSVC, as it appears to support the great majority of C++11 already. As far as I can tell, this would mean using MinGW (I haven't seen any other native Windows versions of GCC). But I have questions about whether this would be worth trying:

  • Can it be used as a drop-in replacement for cl.exe, or would it involve a lot of hacks and compatibility issues to get Visual Studio to use a different compiler?
  • The main selling point for Visual Studio, in my opinion, is it's debugger. Is that still usable if you use a different compiler?
  • Since GCC comes from the *nix world, and isn't native to Windows, are there code quality issues with creating native Windows applications, versus using the native MSVC compiler? (If it matters: most of my projects are games.)
  • In other words, will the quality of my compiled exe's suffer from using a non-Windows-native compiler?

7条回答
放我归山
2楼-- · 2020-05-11 06:40

Consider the Intel compiler (or "Composer" as they seem to have taken to calling it) as another option. I'm not too sure where its C++11 support is at compared with MS (certainly it has lambdas), but it does integrate very nicely with VisualStudio (e.g different projects within a solution can use the Intel or MS compilers) and there's also been some efforts made to match the MS compiler commandline options.

查看更多
登录 后发表回答