views:

387

answers:

10

I'm looking for a good IDE for C++ that has most or all of the following properties (well, the first 4 or 5 ones are mandatory):

  1. cross-platform (at least Mac, Linux)

  2. of course, syntax highlighting and other basic coding editor functionality

  3. reasonably responsive GUI, not too sluggish on mid-size (say, 100 files) projects (both my Linux and Mac computers are 5 years old)

  4. code completion

  5. integration with gdb

  6. SVN integration would be nice too

  7. refactoring (rename a variable semi-automatically throughout the codebase, etc.)

  8. can display class hierarchy

  9. can add hypertext-style links to the code (so you can click on a function/class name and it brings you to the declaration),

  10. can show code parts that (potentially) call my function (I know that's hard to do for C++ so I added the potentially)

So far, I've been using Emacs for everything, but I think advanced features that give me more overview and search capabilities like the last three would be nice. I'm tired of just using grep and find on my codebase.

Basically, I want most of the things for C++ development that Java IDEs usually do.

I see Netbeans can be used for C++, as well as Eclipse. I think they would fit my requirements. Has anyone actually used them for daily coding? What are the differences? What are your experiences? Code::Blocks is more lightweight and doesn't do many of the things listed above, right?

Note: I don't need a GUI builder.

Update: With the bullet point 10 I mean that I can give it a function name (e.g. Foo::setValue), and it shows me all occurrences where this particular function (and not other functions of the same name, like Bar::setValue) is called in my codebase.

+1  A: 

codeblocks is open source !!

http://www.codeblocks.org/

So are NetBeans and Eclipse.
anon
+5  A: 

Code::Blocks does the first 5 and it's also got class method browsing (though not a heirarchy display). It's a much more lightweight solition thaen Eclipse or NetBeans, but if you like the minimalist approach it's pretty good.

To summarise CB versus your requirements:

  1. Yes
  2. Yes
  3. Yes
  4. Yes
  5. Yes
  6. No - but you can add it easily
  7. No
  8. No, but similar functionality
  9. No
  10. Can go from definition to decl and vice versa, but no callers list

As all the solutions you mention are free, you could always try them all and then make a decision on which one to stick with. That's what I did.

anon
How were your requirements different? Did you pick Code::Blocks then?
Amit Kumar
Different from what? From the questioners? I don't want SVN integration (I use Tortoise) or some of the other things. Yes, I picked CB.
anon
10: like Visual Studio's 'show references'. right click on a method or variable, and it tries to show you all the places code calls or uses it. Its a little hit and miss sometimes, so I just 'find in files' for the method name.
gbjbaanb
9. is go to declaration, so it is actually yes.7. is partially yes, using replace all
Amit Kumar
9 Says add hypertext to code - you can't do that. There is a lot more to refactoring support than "replace all"
anon
+1  A: 

Go for Eclipse. If you have a decent computer, it is fast enough and has best possibilities with its plug-ins.

softly.lt
Netbeans and CodeBlocks have plugins too.
anon
+1  A: 

codeblocks have a lot of features just check them up ! and it is free !

Yassir
Netbeans and Eclipse are also free.
Amit Kumar
+2  A: 

Java based IDEs (Netbeans and Eclipse) are sometimes somewhat slow. Also their main focus is Java. One problem with Eclipse is that it is difficult to use for small screens, such as in laptops. I prefer to work usually in vim + ctags (to perform the functions of grep and find), and when I have some advanced operations like comparing two directory hierarchies, I use Eclipse. I've not used Code::Blocks much, but I hear good things about it.

Coming from Emacs, I think you'd prefer something lightweight and not heavy-weight. I would consider Code::Blocks then as a good candidate for exploration.

Amit Kumar
+2  A: 

I'd recomend Netbeans, in 6.5, its pretty fast IDE and offers all 10 of your requirements.

Darth
+3  A: 

I recently asked this same question. I ended up choosing Eclipse with the CDT plugin and the Cygwin libraries. I've been pretty happy with it, except I haven't quite got the hang of the debugger. The window for walking through source on the debug perspective is pretty small, for some reason I haven't figured out how to see into arrays, and I think I knocked out one of the windows for displaying variables and don't know how to get it back. I've ended up abandoning the debugger perspective and just walk through debugs in the normal perspective.

Also, I use Eclipse for Java, so the helped minimize the learning curve. It can do refactoring and you can integrate svn.

Jack BeNimble
It's horrible to use eclipse on laptops with limited screen size.
Amit Kumar
Ah, maybe that's it. I'm on a laptop, and I increase the screen resolution to boot.
Jack BeNimble
CodeBlocks works perfectly on my 9 year old laptop :-)
anon
I would've checked it out, had I known. I'd be really happy with Eclipse if it weren't for the tiny debugger window.
Jack BeNimble
You can always increase the size of an individual view, drag it to a different part of the screen, temporarily maximize that view, etc. in Eclipse. You're not stuck with the default screen layout.
David Citron
I'll check into it. I will be good if I can customize the default view.
Jack BeNimble
@Jack -- more info here: http://wiki.eclipse.org/FAQ_How_can_I_rearrange_Eclipse_views_and_editors%3F -- anything with a little tab and a close box is a "view" in Eclipse terminology. All can be moved/resized. Happy dragging!
David Citron
+4  A: 

In addition to the ones mentioned, there's QTCreator, which has "Rapid code navigation tools" though I've not used it.

I think though that the non-essential requirements aren't so good, you can easily see where a method is being called using search! (of course, if you have a huge class hierarchy where every class has the same named method, you've only yourself to blame :) if you havn't laid your classes out in an easily understandable way)

gbjbaanb
+1  A: 

If you already know Emacs, it may be easier to just start using a few more packages, than learn a whole new IDE.

For example, you can easily do #9 with Emacs: just run tags once and then M-. RET anywhere.

You also have to weigh the IDE's features against what you lose. For example, most IDEs don't tend to have Emacs' easy macro capabilities or numeric prefixes, which are often like a more general form of refactoring.

+1  A: 

It is not only the IDE that matters - you would probably need to be able to build you application outside of the IDE (i.e. continuous integration).

Consider using CMake to create a cross-platform description of your build scripts. Once you have the CMake Script (which is straightforward) you can generate from it project files for the IDE of your choice - eclipse, kdevelop, Visual Studio, codeblocks, etc.

I would suggest using eclipse as an IDE. There are few options of how to use CMake with eclipse. Play around, and find the best for you.

Once more - CMake is not only cross-platform it is also cross-IDE. And CMake scripts are very readable, a simple make file would look like this:

project(hello) 
add_executable(hello hello.cpp)

Now compare that with makefiles, or setting up a project in your favorite IDE!

siddhadev