GCC on Wintel - Cygwin or MinGW
mindrobots
Posts: 6,506
I'm tooling up toward the GCC/Eclipse programmers waltz coming toward us PropellerHeads and strated installing tools on my Windows system.
Eclipse-gcc went in fine but lo and behold, step #0 (which I skipped) was to install gcc. Now, I'm faced with the choice of either Cygwin or MinGW for gcc tools.....since we're all so fond of debating conflicting sides of a solution, I thought I'd open up this can of worms as a general topic.
So, which would the wise person choose for gcc support on Windows (sadly, I have XP, Vista and Windows7 running various places if that matters)??
Discuss.......
THANKS!!
Eclipse-gcc went in fine but lo and behold, step #0 (which I skipped) was to install gcc. Now, I'm faced with the choice of either Cygwin or MinGW for gcc tools.....since we're all so fond of debating conflicting sides of a solution, I thought I'd open up this can of worms as a general topic.
So, which would the wise person choose for gcc support on Windows (sadly, I have XP, Vista and Windows7 running various places if that matters)??
Discuss.......
THANKS!!
Comments
1. Download and install the Oracle Java SE 6 u26 JDK (don't install Java SE 7, if crashes on "for loops"!!!): http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html (you can probably use the JRE; I use the JDK so I can also develop in Java if I want to...)
2. Download and unzip the "Eclipse IDE for C/C++ Developers" version: http://www.eclipse.org/downloads (this comes pre-configured with the C/C++ plug-ins...)
3. For a C/C++ compiler, I use Strawberry Perl .zip version...
3a. Download Strawberry Perl 32-bit or 64-bit .zip version (regular .zip, not the portable.zip version...)
3b. Extract zip file, rename folder to strawberry (or whatever is good for you that's not a hundred chars...), copy to c:\ root (so c:\strawberry)
3c. Edit your Windows path (Control panel > System > etc.) and add ;c:\strrawberry\perl;bin;c:\strawberry\c\bin
4. Learn you some C/C++ (and/or Java, Perl...)
The reason you can use Strawberry Perl is because it includes a self-contained, pre-configured version of MinGW. Strawberry uses it to compile CPAN modules. The reason that I suggest the standard .zip version is that it requires no installation, and is completely portable. Maybe the "portable" version would work, but they're designed specifically for thimb drive. I know the regular .zip works either way.
EDIT: Strawberry Perl doesn't include GDB, so you would need to find a Windows binary, compile it (probably a good learning exercise ), or just install MinGW, which includes it. There's also Linux, which includes it (or is easy to install it...). Umm, printf() works, too. Or just write bug free code.
So, following the above, you should be set up for Java, Perl, and C/C++ development... at least to a basic (wrt libraries, SDKs, GDB, etc...) level.
I have Strawberry Perl on most of the systems....and the Java SDK on a couple......sounds like I'm most of the way there with Kevin's plan. Except that bug-free code thing.....I've been working on that for 30+ years....ain't gonna happen!!
Thanks,
-Phil
http://perl-node-interface.blogspot.com/2011/03/deploy-perl-application-on-windows.html
Which led me to try this on my PC: perldoc ExtUtils::Embed - which led me to conclude that the capability is there to create .exe files. I've never done perl2exe (my perls aren't that valuable) so I can't compare.
I have grabbed CPAN modules I've needed and built and installed them - it worked very well in my limited experience.
Perl is actually on my employers list of things for me to tackle, so it pays off both in my real life and my hobby life!
For Perl executables, this might be of info... http://par.wikia.com/wiki/Main_Page. I've never needed to create .exes, so I can't comment on the different methods.
Here's more info for Win32 Perl for those interested... http://win32.perl.org/wiki/index.php?title=Main_Page
If you don't mind my asking, can you tell what industry you work in, and what your company want to use Perl for?
For what it's worth, I've used both Cygwin and MinGW extensively (for Catalina as well as for other developments).
I'd strongly recommend MinGW - even though it currently has some issues with Windows 7, MinGW is far easier for Windows users to deal with than Cygwin.
Of course, I'd really recommend Catalina & Code::Blocks - then you don't need either MinGW or Cygwin!
Ross.
I do. The first round of problems were to do with the Microsoft Windows 7 VirtualStore feature - I disabled that and a whole bunch of strange things went away (google "VirtualStore problem" for details).
The next problem was with "make" - it doesn't work the way it does on other Windows/MinGW combinations. I had to modify all my makefiles specifically for Windows 7.
I don't really ever have time to investigate these things deeply, I just tend togoogle for the appropriate workaround and move on.
Ross.
jazzed replied:
So why does this thread even exist?
-Phil
Just a misunderstanding I think. MinGW is a port of GCC to use the Windows API, and may be what jazzed meant by "a binary distribution". But you can also run GCC under a full Unix emulation layer such as Cygwin (which is in fact where MinGW originated).
As the name suggests, MinGW is the "minimum" parts of GNU required to run GCC (and is non-Posix compliant, since it uses the Windows API), whereas Cygwin is a more extensive (and Posix-compliant) port of GNU.
So to run GCC you have a choice between installing MinGW or Cygwin. From within the IDE it probably doesn't make much difference - but you would see differences from the command line. Whether you can really use GCC without having to resort to the command line at least occasionally is a good question. I've never managed it, but then I tend to do things that require you to "peek under the hood". I think most professional users developing embedded software would be the same.
Ross.