views:

3344

answers:

16

What is the best free windows c++ compiler, ideally cross-platform. I've tried Bloodshed, Ganymede, EasyEclipse, Visual C++ express. Visual C++ express is the only one I've been able to get the debugger working on!

+10  A: 

I like both Visual C++ Express and the Cygwin port of GCC, depending on if I'm developing a Windows or more Unix-style application.

James Thompson
+7  A: 

MinGW with MSYS

Judge Maygarden
+4  A: 

GCC, the GNU Compiler Collection

Judge Maygarden
+2  A: 

I think Visual C++ express is the best, cygwin is good for the gcc, mingw is good for the gcc without the dependency of the rest cygwin and open watcom is another you can try.

Edit:

I don't use a cross platform tool as much. Instead I use VisualC++ express 2008 / namke for windows and gcc for nix. I have encountered linking incompatibilities with mingw & cygwin/gcc when used with visual c++ linker. I make sure the code is compatible with all compilers instead.

Tim Matthews
It is nice, but not cross-platform (depending on your target platforms of course).
Judge Maygarden
He said for windows
Tim Matthews
He also said "ideally cross-platform". Visual C++ gets my vote for the best debugger hands down.
Judge Maygarden
Does it do watchpoints? I never got them to work, but that may have been in VS 2005. Until it can do that, I'm sticking to gdb as my favorite. Doesn't look as good, but boy does it get the job done.
David Thornley
+3  A: 

In terms of standards compliance, MinGW is your best bet.

But if an IDE is essential, it's hard to beat visual studio on windows, especially with the debugger being so well integrated.

John T
+1 but only because the VC debugger is so good.
Adam Hawes
+9  A: 

Ok well, I just want to point out something. What you named here aren't compiler. these are IDEs (Integrated Development Environment). When developing on windows there is probably nothing as good as GCC or MinGW. Because if you use something like lc.exe (If my memory is good it is the name of the compiler used by visual c++, it's what I remember, it might changed since visual c++ 2003). You might have problem to port it to other platform. The compiler made for windows might not interpret C/C++ code like gcc or any other compiler. In other word, aim for the compiler that is more widely used. If you compile with gcc on windows, the code shouldn't be that much different on let say Linux. By the way, a crossplatform compiler won't make your apps automagically crossplatform. You'll have to write crossplatform code. avoiding ifdef everywhere. You'll probably end up with files for windows and other file for other platforms.

Ok so you have the compiler and you also need linkers which should come with the compiler because a compiler alone is pretty useless if you can't link it to anything else...unless your compiler can link too.

anyway, IDE are the platform you'll work on. but the compiler for open source project is generally the same(gcc). I guess you can use the compiler that come from visual c++ on eclipse but I guess people only do that when they have specific needs.

As for IDE, I used to work with Anjuta on linux. It's was pretty damn awesome as every needed libs for a project was as easy to include as checking a box. I didn't used kdevelop for a while...didn't used visual studio...I think eclipse is a pain in the ass...

So I ended up working with vim. It's not an IDE but it does what I want. Doesn't lag on me and I kind bind approximatively anything I like. Like today I binded a php script that would generate a pdf then open it inside a viewer.

Learning something like vim or emacs isn't as easy as learning how to use notepad but it's clearly worth it...You can create a powerful workflow with these editors unlike people who only relly on intellisense or auto-completion in other IDE...While vim actually allow auto completion...which is funny.

Sybiam
Just for the record: The Visual C++ compiler is cl.exe.
Nick
Thank you I edited it
Sybiam
+1 for mentioning Vim :)
xk0der
You start out good, then start talking randomly about VIM and Emacs. Doesn't seem totally in line with the windows specific question.
Simucal
@Simucal: I wasn't randomly talking about vim/emacs. He asked for a cross platform solution. Vim/Emacs are lightweight solution for cross platform development. And yes, you can install vim/emacs on windows. Which is why I mentioned it.
Sybiam
A: 

Download the Polarion distro for Eclipse. It already has the C++ module configured, as well as Subversive.
The full version of Visual Studio Pro is better than Eclipse for C++, but a lot of the functions have been trimmed off on the express version.

Having pointed you in a good direction for an IDE, @Sybiam is correct.

WolfmanDragon
A: 

If you don't ever plan on your app leaving Win32 land, then use MS's tools, they are excellent. If you want to be as cross platform as possible, a cygwin environment with gcc is a great choice.

prestomation
A: 

It's slightly off topic, but I have been using a cross compiler for about 6 months now. All my Windows work is cross-platform so I build/test/debug on *nix and then cross compile with a MinGW version of gcc/g++ for Windows for final testing. It's been working well for me thus far.

I prefer the tools and workflow that you get on Unix-y platforms. Such a nice developer platform just isn't available for Windows (good command shells, fantastic tabbed terminal emulators, vim, remote working by SSH, etc).

So, to sum it all up: the mingw toolset is a good cross-platform set of tools you could use. It's free, and it's not GPL so you can use it for commercial development as well.

Adam Hawes
Is it hard to setup a cross compile version of MinGW? Are there any instructions anywhere? Able to download an RPM (openSUSE)?
Evan
The tools aren't quite as nice, but still decent. Have you tried Console2 for tabbed console (no shell though), or Putty for SSH? Vim is available of course. I used to use Lemmy (vi clone) a lot, but now use Notepad++ for most things.
Ryan
@Evan: On Ubuntu (and Debian) you apt-get install i586-mingw32-gcc (or similar). For others the mingw site has a cross-build script to make the cross compiler for you.
Adam Hawes
@Ryan: I hadn't seen Console2 before. I use PuTTY but I really do need a tabbed interface after getting so used to it. There's a couple for PuTTY, but they really all were crap. Vim on Windows is a far cry from Unix vim - the cygwin version isn't all that and I never liked the GUI versions.
Adam Hawes
A: 

Thanks for the responses! I ended up going with Eclipse/CDT/Cygwin. The trick was to install both gdb and make with Cygwin. I had trouble getting any of the Eclipse flavors to debug using MinGW. A command line invocation showed some obsure error message that talked about "elf" - that's about all I remember of it. I'm pretty happy to have figured this out. I spend hours trying to find the best option.

Jack BeNimble
I set up a MinGW/MSYS/Eclipse combo and had to fiddle with the gdb integration to get IDE-based source-level debugging to work. It was all rather painful to setup despite that end result works pretty well.Hmm, wonder if there'd be enough demand to make any money by offering a fully turn-key experience to install all this onto a Windows computer? Would folks pay, say, $40 to get a fully integrated distribution that rendered this as simple as running one installer?I was interested in Objective C 2.0 - it would be nice to get Apple's support of garbage collection and try/catch/finally.
RogerV
A: 

just try codelite, one of the best open source C++ multi platform IDE

Priyank Bolia
+1  A: 

Code::Blocks isn't too bad, although I find the interface feels a bit "plastic". Cross-platform, works with multiple compilers - bundles GCC.

Rob
A: 

MS Visual IDE is better on Windows although it does not directly support 3rd party compilers. You can use a trick of configuring a 3rd party compiler on the external tools though. MS Visual IDE is slow and it sucks your memory. Its the best for windows though. MS has the best intellisense.

A: 

Didn't try it myself yet but Qt Creator is supposed to be good.

shoosh
A: 

gcc C++ is better than MS C++ (the compiler only) but these GNU compilers use an alien version of assembly. What kind of nonsense is that. Its the best but the assembly looks like it was developed by an alien. If this is a scheme to critisize and oppose Intel and Microsoft it is unrealistic. I dont like Microsoft but their C++ IDE is good. I love gcc except for its martian assembly.

A: 

I love netbeans 7 the most.

XMAN