c++ compiler (g++) on windows?

chomsky

Limp Gawd
Joined
Aug 18, 2004
Messages
251
Heya
I'm a java guy at heart but now I'm getting hit with all these c++ assignments and I dont have an environment to code in on my home pc which is strictly windows at the moment. Im stuck with no internet half the time and dialup the other half but there are a few times this week where I could dowload an ide or a compiler, does anyone know of a good no-hassle ide or command-line style compiler for windows? We're using g++ on the solaris machines at school and I would prefer to use that but I cant find a windows binary of it.
thanks in advance, Jason
 
you could go with MiniGW and DevC++ (DevC++ includes minigw as well so you don't have to download it seperatly)
or Cygwin for a more *nix like environment in Windows.
 
thanks for the quick replies. Im going to try the devc++ first as it looks like I wont have to search around too much to know how to configure it. I was expecting things in the 100mb + range but it's so small I'm DLing it right now (...2 1/2 hrs..ridiculous...), I'm hoping that'll do, so thanks again
 
If your school shelled out for the higher level MSDN AA subscription, get Visual Studio off that. ;)
 
movax said:
If your school shelled out for the higher level MSDN AA subscription, get Visual Studio off that. ;)
The problem is code written in Visual Studio might not compile with g++, both have quirks that can collide and cause code to compile and work on one without working on the other. I think cygwin might be the best choice to be honest since it's acting like a Posix emulation layer, and so most of the headers and libraries will be similar API wise. MiniGW actually includes Win32 headers so you can compile windows applications with it, but I think mikeblas actually noticed a bit of binary bloat due to the stl libraries included with MiniGW.
 
Xipher said:
MiniGW actually includes Win32 headers so you can compile windows applications with it, but I think mikeblas actually noticed a bit of binary bloat due to the stl libraries included with MiniGW.

Yeh, for example:

Code:
#include <iostream>

int main() {

}

g++ file.cpp -o file -s

That still produces a 288KB binary. You can get it down to 90KB by packing it with upx with the 'best' option ( not saying you should ), but even then, MS's compiler will still produce a smaller binary.

As programs get larger though, it's supposed to even out.
 
DevC++, Visual C++, Borland, and Eclipse are all excellent IDE/SDK choices.
 
No, I'm pretty sure what he seek is mingw. There's really no upside to djgpp that I can see. (It'd take a brave brave man to name "DOS" an upside)
 
Most colleges I know of seem to use Visual Studio 2005 or Borland. You should beable to use the free Express Edition of Microsoft Visual C++.NET and just use an Empty Project and add the .cpp source file.
 
benamaster said:
Most colleges I know of seem to use Visual Studio 2005 or Borland.
Yeah, the free Borland compiler isn't bad for schoolwork. It's a little over 8MB for the compiler and debugger, plus another 440KB for SciTE.

VS is better for making Windows apps of course.
 
eloj said:
gcc 3.4 is an older compiler though, considering the latest release series is 4.1.1 (with 4.2 just around the corner). Odd for a C++-junkie to be running 3.4, I must say.

Hmm. Might have to do with boost lib compatibility or something. Just building boost with the newest stable release of Mingw often requires pulling boost of cvs.

Edit: STL will add reasons why to his mingw page when he gets a chance.

In short though, to make Mingw, patches need to be applied to gcc. Patches for more current versions of gcc are often delayed because of bugs in gcc that can cause problems for mingw. Basically, the port is behind the orginal a bit.

Have you built gcc 4.11 for win32?
 
I haven't built it myself (it _is_ a chore), but I'm running a mingw build of gcc 4.1.0 I googled.

The good news is that i686-mingw32 is very likely becoming an official secondary platform from gcc 4.3 and on, which should help immensily.
 
eloj said:
I haven't built it myself (it _is_ a chore), but I'm running a mingw build of gcc 4.1.0 I googled.

The good news is that i686-mingw32 is very likely becoming an official secondary platform from gcc 4.3 and on, which should help immensily.

Oh, O.K., cool.
 
For those wondering what that actually means, here is the post from Mark Mitchell (current GCC release manager) where he outlines his suggestion for the steering commitee (SC) for platform list for GCC 4.3

The exact meaning of "primary platform", "secondary platform" and "others" change over time, but "Our release criteria for the secondary platforms is: The compiler bootstraps successfully, and the C++ runtime library builds. The DejaGNU testsuite has been run, and a substantial majority of the tests pass."

Can't hurt to get some more lovin' from the devs.
 
I havent tried this myself but it would seem to me that there has to be a Live Linux cd out there somewhere that has g++ installed on it. I would go as far as to say that most Linux Live cds have g++ installed, guess I've never really looked though. Just pop in a live cd do your coding, save to a flash drive, and your done.
 
metallicafan said:
I would go as far as to say that most Linux Live cds have g++ installed, guess I've never really looked though. Just pop in a live cd do your coding, save to a flash drive, and your done.
Most don't, but you can add it and reburn if you take the time. I added developer tools (compilers, IDEs and libraries) to PCLinuxOS on a USB flash drive, which is easier than doing it for a CD.
 
Back
Top