views:

587

answers:

8

Saludos a todos en stackoverflow.com!!

So... I'm a C++ newbie currently taking the subject of Data Structures, and I want to consult something with you guys:

Since I started studying Systems Engineering, I've been using the last version of Dev-C++ for all my programming projects. It has done it's job well so far, but it has a FATAL flaw... trying to debug your code in it it's just... awfully painful!! Everytime you activate the debug mode you have to cross your fingers and hope it doesn't crash in your face just before the variable you are watching even changes.

Then, I though about using Visual-C++ from Microsoft, as it is free too; however, I asked my teacher and told me not to use it in the course, as it is not standard (compiled programs in it will only work for Windows); we are required to make code that can be compiled both in a Windows and Linux environment, and once compiled in any, being able to use the application on both environments.

So people, I want you to please give me advice: Which C++ compiling software out there has a strong and/or stable debugging mode, implements the standard compiler (is it called g++, by the way??), and it's hopefully free???

Thanks for your attention. Gracias y hasta luego ^_^ (BTW, happy first post!!! ^o^)

+4  A: 

Code::Blocks - it's free, it's cross-platform, it's pretty good. You can download a package consisting of the CB IDE, the MinGW C++ compiler and the gdb debugger. Installation is very straightforward.

anon
Gracias! It really was what I was looking for. I installed it, implemented the "List ADT" on it, had to do some debug, and it worked like a charm!! Bye-forever Dev-C++ ^^. And thanks again, Mr. Butterworth =D
NeoGlitch
+10  A: 

There is an implementation of g++ and GDB ( the Gnu Debugger ) for windows called Mingw that works very well. Though since I'm guessing you're also looking for a graphical IDE / debugger, I'd point you at Eclipse. The C Development Tools for eclipse include an excellent interface to the Mingw build tools and GDB. Also, on your comment about a compiled program being used on both Windows and *nix, this is not possible as far as I know.

Colfax
I thought Dev-C++ already used Mingw
BigSandwich
I've never used Dev-C++, I just assumed it was something else.
Colfax
+3  A: 

It sounds like you're asking for an IDE ( Integrated Dev Environment ).

Eclipse might be good for you. It's supported on both Windows and Linux.

http://www.eclipse.org/cdt/

Robert S. Barnes
+1  A: 

MinGW is pretty good as @Colfax state. Consider using ddd with Cygwin which makes using gdb somewhat easier. See this SO question

But wait...isn't Qt 4.5 released as LGPL now making that a great free tool? See here

epatel
+3  A: 

In terms of compilers themselves GCC is your best bet. It is a compiler in the purest sense of the word though it doesn't have a native interface to it.

I would be looking at finding a good environment to develop in that could attach to it.

Straying from that my personal preference in IDE's right now is eclipse, but that is really a personal thing.

Matt
+7  A: 

It depends what you mean by 'standard'. You're going to have to compile your code on linux and windows anyway. There is no way to create and executable that will run on both. Just use VS to compile and debug on windows, then make sure it also compiles and runs under GCC on linux.

I think he just wants you to use the same compiler on both, so you don't have to deal with differences between compilers. I think that's good for you. Writing code that can compile on multiple compilers is important because it shows you what parts of the standard really are standard.

BigSandwich
A: 

As a linux guy, I think the best experience comes with GVIM as editor and Mingw as programming environment. GCC is the standard, but LLVM-GCC is very promising and comes with a Mingw build ready for use in windows.

alvatar
+2  A: 

If you use only the standards features of C++, you can use Visual Studio Express C++. Your are not obligated to use the windows only extension of the compiler: MFC, ATL, Wizards, etc.

But if you want to make something portable then trying to target both compilers (GCC and VS) is really a better exercise anyway.

Also recently Nokia released a new multiplataform ide QtCreator, it is a first version but at least it deserve to be taken in consideration.

Ismael