Any specific reason to choose MinGW over VC++ on Windows ?

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
User avatar
Mind Calamity
Ogre Magi
Posts: 1255
Joined: Sat Dec 25, 2010 2:55 pm
Location: Macedonia
x 81

Any specific reason to choose MinGW over VC++ on Windows ?

Post by Mind Calamity »

Yeah, the title pretty much sums it up, so, for what purpose would one choose MinGW over VC++ ?

I mean GCC/G++ are native to Linux/*nix, why would you need to use those compilers, except for assuring that the code is completely cross-platform and will compile out-of-the-box on every platform.

Share your opinions guys! :)
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by jacmoe »

There is no reason at all to use MinGW instead of VC++.
Absolutely none.

The only thing I can think of as being a reason is if you are making use of a library which haven't been ported to Windows yet - most often due to it not being written in a cross platform way.

If you use VC++ on Windows and GCC on Linux, then your code is cross platform (or is quickly going to be).

If you use MinGW you are only creating an illusion, because at the end of the day it's not cross platform. It's posix/Linux/Unix on Windows. (D'oh).
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by CABAListic »

Really not too many reasons for a normal developer unless you are an Open Source fanatic.

There are a few for some special cases:
1. Cross-compilation from Unix is possible with MinGW, so you could build your Windows app from Linux.
2. MinGW has C99 support, Visual Studio does not. A few open source libraries require it and don't compile with Visual Studio as a consequence (most prominent example to my mind would be ffmpeg).
3. MinGW compilation times are probably slightly faster than Visual Studio, particularly the later versions of the latter. But this comes at the cost of increased binary sizes.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by jacmoe »

Requiring C99 support is not cross platform.
But good points.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by jacmoe »

And Open Source Fanatics using Windows ?
Totally oxymoronic. :lol:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by Kojack »

I used to use mingw, but only for arm coding on gameboy advance. I still used visual studio for the actual editing of the code.

Actually visual studio has had arm target support since 2005 (some windows mobile devices are arm based, like the dell axim which uses intel's xscale arm chip), but I've never heard of anybody trying it for gba development.

Mingw would be interesting if it had clang support. There's some really cool code analysis things clang lets you do, but I couldn't find a working windows build.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by Klaim »

As recent versions of GCC provide more C++11 language features implementations than VS, for some bleeding edge code you might want to use GCC even on windows. There is a special MINGW version provided by I don't remember who that is always up to date with GCC.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by CABAListic »

jacmoe wrote:Requiring C99 support is not cross platform.
But good points.
But only because Microsoft has (again) decided to forsake support of an existing standard...
In any case, since I'm not doing any C development, this problem doesn't concern me personally, except that it rules out ffmpeg as a possible choice of video rendering library if I ever needed one.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by Klaim »

Cabalistic wrote:But only because Microsoft has (again) decided to forsake support of an existing standard...
AFAIK, no C++ standard is based on C99, isn't it?
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by CABAListic »

Yeah, C++ is not affected. It's entirely a C issue. Which is why it doesn't really concern me :)
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by Kojack »

Mingw/gcc/clang have most of c99, but not all apparently.
http://en.wikipedia.org/wiki/C99
GCC:
As of July 2011 in mainline GCC, 43 features have been completely implemented (12 suffer library issues), 1 feature is broken and 6 are missing.
Clang:
Does not support C99 floating-point pragmas.
There are compilers with better support for C99 (such as IBM C and Sun Studio).
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56

Re: Any specific reason to choose MinGW over VC++ on Windows

Post by Klaim »

Yeah, bigger issue being that CLang doesn't have a lambda implementation yet. If it had, you could use C++11 lambda, move semantic/r-value references, auto/decltype on GCC, CLang and VC. Now you can't because Microsoft focus on libraries first, GCC on language features first and CLang implement things as they can.