tags:

views:

561

answers:

4

GCC is a very well respected multi-language compiler (from what I've gathered). One thing I've not been able to definitively find out is: Is it possible to use GCC on windows without anything extra like Cygwin or MinGW?

I've learned that if you use GCC on Cygwin, there is a dependency on a DLL. If you use GCC with MinGW, you eliminate that dependency but you still must have MinGW to use GCC.

Is it possible to build GCC and utilize it by itself, completely native to Windows? Like Microsoft's Compiler? After reading around, my guess is no. But I'd still like more info, if possible.

If not, why does GCC require environments like Cygwin or MinGW? I understand this now. It is because GCC requires a Unix/POSIX environment. Why it does, it still beyond me.

I did find this and it helps but doesn't really answer my question: http://stackoverflow.com/questions/187990/why-does-gcc-windows-depend-on-cygwin

To refine my question, I guess what I'm trying to understand why GCC can't stand on it's own -- Where I have just "GCC.exe".

A: 

I don't think so. I've had to compile some command line apps for people in the past and always had to use cygwin.

I think the biggest reason being posix compatibility, which is what cygwin strives to bring to Win32.

Omega
mingw is getting better . I routinely compile gdb and binutils with it (for cross- purposes).
Marco van de Voort
+5  A: 

For MinGW, you need MinGW in the sense that MinGW provides the implementation of the gcc language system. I don't see how your question makes sense - it's like "Can I use VC++ without installing VC++?"

To clarify: MinGW is the GCC compiler executable(s), headers and support objects. There isn't anything else. There is a related but independant package called MSYS which provides some posix utilities, but you do not need this in any way in order to use the MinGW version of GCC.

anon
I can use the compiler without having the IDE installed. I'd just need to compiler executable and any associated header and support objects. I'm not a compiler expert; I don't claim to be. But, I feel my question still stands and makes sense. Perhaps you need to abstract away from some of your assumed knowledge -- your knowledge might be what I'm missing.
Frank V
anon
Are you trying to say that MinGW IS, basically, what I'm asking about/for? That it is a version of the GCC that can most closely match what I'm asking about?
Frank V
Frank: yes. At least for a large part, if your understand your question correctly.Afaik mingw is messing with drive mapping schemes too though.
Marco van de Voort
I've been using Cygwin at the direction of my instructor (for a Master's course). I can switch to MinGW after the class is over. Also, sorry for deleting my comment and re-posting it. I found a typo and I wasn't sure if the typo interfered with the understanding. So I replaced it.
Frank V
Yes, that's what he means.
Dana the Sane
anon
Yes, Neil is right, MinGW *is* gcc, ported to windows.
KeyserSoze
Thanks all! Apparently I had a bad assumption... Sorry, but thanks!
Frank V
A: 

What is exactly the problem with mingw? And what is native?

mingw used to generate pretty much standalone binaries, and maybe that is even more native than MSVC's, which require msvcrt, a component that needs to be installed sometimes.

So maybe you could explain what you tried with mingw, and what the exact problem is.

Marco van de Voort
A: 

To disable mingw's extra dependency simply don't use exceptions (-fno-exceptions), I haven't used cygwin so not sure.

OneOfOne