views:

1683

answers:

9

I'm trying to port a Linux app to windows. Nothing huge, just a small command line utility. However, the last time I worked with C in Windows, it was a 'hello world' app in Visual Studio 6.

I'm trying to avoid meeting a new IDE, so I'd like to use Netbeans' C/C++ plugin. I just need a compiler.

Can anyone suggest a free 32-bit compiler that doesn't come with an IDE attached?

+30  A: 
csl
The official MinGW builds of GCC are based on an older version (3.4, I think.) You might consider these more current builds instead: http://www.tdragon.net/recentgcc/ , though unfortunately MSYS (required by NetBeans) isn't included and I don't know how well vanilla MSYS works with these builds.
crosstalk
+6  A: 

Microsoft's VC++ compiler is by far the most common (and definitely one of the best) compilers on Windows. It comes with an IDE, but you don't have to use it. You can easily use the compiler (cl.exe) from the command line.

Alternatively, there's MinGW, a port of GCC.

jalf
+12  A: 

The Windows SDK has a perfectly fine compiler. Since you will need the SDK most likely anyway, why not just use that compiler? You can find it usually in C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\Bin (the compiler is called cl.exe, the linker link.exe)

Stefan
Good point. I'd forgotten cl.exe actually comes with the Windows SDK. This seems like an obvious choice.
jalf
NetBeans's C++ plugin sadly does not support the MSVC toolchain, so CL.EXE from WinSDK won't work for the OP.
crosstalk
I have to download more than 1GB to have a compiler? WTF?
blaxter
No, you have to download more than 1 GB to have the SDK needed for Windows development *in general*. It just so happens to contain a compiler as well.
jalf
+1  A: 

Just to be different.

There is openwatcom and LCC. Though they come with IDEs attached, they are also usable from the commandline.

kinjal
+1  A: 

Setting up MinGW in Windows can be a bit daunting (I tried it). Afaik MinGW only supports gcc v4 in beta. You can try it anyway. If you need an IDE for it, try Eclipse.

Personally, I'd however recommend Microsoft Visual C++ Express Edition 2008, which comes free of charge. It only lacks a few tools (e.g. resource compiler) you may not need anyway when porting from another OS.

karx11erx
+2  A: 

Since no-one has mentioned Cygwin before me, I will. I use that; it works pretty well. I also have the MS VC++ 2008 (free download) edition installed; I don't often use it.

Jonathan Leffler
+1  A: 

You may also look at:

The free country: C / C++ Compilers

FunnyBoy
+1  A: 

DMC by digitalmars

BCS
A: 

Be aware that when using cygwin c++ compilers, you can't move those apps to another computer, unless they also have the cygwin.dll s.

Drew