tags:

views:

411

answers:

4

MSYS and UNIX-like build systems apart; why does Mingw exist? What I mean is, why isn't win32/64 just another target available in "vanilla GCC"? Are there technical reasons for this or are they "political"? It would seem to me that there isn't really anything special about the Windows platform that would make a GCC port to it "incompatible" with the original GCC.

+5  A: 

Mingw isn't just the compilers - it's also the libraries and headers (and whatever other support files you might need).

GCC is just a compiler. Mingw is a full environment.

Matthew Iselin
GCC is a collection of compilers.
Petros
True, but the point still remains.
Matthew Iselin
Does that mean that I could download the GCC source, compile a compiler targeting win32/64 and compile code with it (except there are no libraries and headers)?
vonolsson
You can build a compiler that will create PE files, so all you're really missing then is the libraries and headers to be able to do anything useful with that. You'd also be missing things like CRT0.
Matthew Iselin
A: 

well, while you can use cross compiler to produce win32/64 binary codes from GCC, someone has to port all the C runtime libraries across though. Both Mingw and Cygwin are created for this purpose.

oykuo
+2  A: 

MingW is intended to allow easy porting of Posix apps to windows. It's simply a "thinner" layer than CygWin, so not everything might work where windows too different. CygWin allows provides enough insulation that even the scripting tools to build and generate code run.

Edit: Microsoft is very fond of making there own standards, and want to put there own brand on things for which open standards already exist. i.e. OpenGL -> DirectX, Java -> .net, OpenCL is the next standard they want to spurn. This makes them a bit of a pain for non sponsored project to support them as a target. They have always turned away from anything that allows easy cross platform development, because they only want you to develop your app for there OS. It's a marketing strategy, control the brand, control the platform, and make it painful for people to support other OSes. MingW is required because GCC can generate x86 code, but even the most basic runtime support is different than Posix based OSes.

NoMoreZealots
A: 

From MinGW's main site

Offered in easily installed binary package format, for native deployment on MS-Windows, or user-built from source, for cross-hosted use on Unix or GNU/Linux, the suite exploits Microsoft's standard system DLLs to provide the C-Runtime and Windows API.

Petros