Shop OBEX P1 Docs P2 Docs Learn Events
GCC on Wintel - Cygwin or MinGW — Parallax Forums

GCC on Wintel - Cygwin or MinGW

mindrobotsmindrobots Posts: 6,506
edited 2011-08-06 20:21 in General Discussion
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!!

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2011-08-04 15:04
    I installed gcc under cygwin on both an XP system and a Windows 7 system. Both of them work fine. Initially, I did have a problem on the Windows 7 system. It would encounter an error half-way through the P1 GCC build. I had the Watcom compiler on that system, and I forgot to uninstall it before installing GCC. I uninstalled Watcom, loaded a few more utilities under cygwin, and rebooted the computer. It worked OK after that. I'm not sure which step fixed the problem.
  • LeonLeon Posts: 7,620
    edited 2011-08-04 15:10
    I use gcc with Cygwin and Win7 x64 occasionally. I don't use Eclipse with it.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-08-04 15:47
    Not sure which Eclipse you installed, but I tested the following out on a W7/32 machine, and it compiles my hello world C program...

    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.
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-08-04 17:39
    Thanks guys!

    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!! :lol:
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-04 19:00
    This Strawberry Perl thing has me intrigued, to say the least. I've been using ActivePerl under Windows forever and have been mostly satisfied with ppm install and the ability of perl2exe to package Windows/DOS Perl applications. But I run into real trouble with Perl modules that don't exist in any ppm repository and that need to be compiled from CPAN C source code. So I ask those familiar with the Strawberry flavor of Perl, what can I gain and what are the gotchas of switching from ActivePerl? Is there a facility similar to perl2exe that can be used to distribute native .exe files without requiring a Perl installation or a special operating environment?

    Thanks,
    -Phil
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-08-04 19:59
    Phil I know enough Perl to usually confuse myself and write terribly ugly code with the constant help of the Llama and the Camel....with that said, I do have Strawberry on my laptop and just found this link:

    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!
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-08-04 22:54
    I started using Strawberry Perl after trying to install something from CPAN from ActivePerl. I think ActiveState had dropped support for something in PPM. I like ActivePerl, and PPM, but I've found that I like not having to install even better.

    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
    mindrobots wrote:
    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!

    If you don't mind my asking, can you tell what industry you work in, and what your company want to use Perl for?
  • RossHRossH Posts: 5,519
    edited 2011-08-04 23:35
    All,

    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! :lol:

    Ross.
  • jazzedjazzed Posts: 11,803
    edited 2011-08-06 16:48
    I use Qt/MinGW and Cygwin on the same Windows7 PC. I don't have any trouble whatsoever.
  • RossHRossH Posts: 5,519
    edited 2011-08-06 17:36
    jazzed wrote: »
    I use Qt/MinGW and Cygwin on the same Windows7 PC. I don't have any trouble whatsoever.

    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.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-06 19:51
    I'm totally confused. In another thread I asked the following question, based on the underlying premise behind this thread:
    "Will the resulting tools run natively under OS/X and Windows, or will they necessarily require their own Linux-compatible sandbox, such as X11 under OS/X or Cygwin under Windows?"

    jazzed replied:
    "We will have binary distributions for the major operating systems: Mac OS/X, Linux, and Windows. Cygwin will not be required."

    So why does this thread even exist?

    -Phil
  • RossHRossH Posts: 5,519
    edited 2011-08-06 20:21
    ...
    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.
Sign In or Register to comment.