views:

4808

answers:

23

I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind.
What tools do other people use? Is there anything out there for Linux that rivals the slickness of Microsoft Visual Studio?

+5  A: 

g++ and make

superjoe30
And you do your editing with 'cat', I presume?
Arafangion
Nope, I use a remote desktop connection to my windows computer and use eclipse to write code, then copy and paste it into g++
superjoe30
I hope you're joking o_O
Nicolás
What about a magnetized needle and a steady hand?
machielo
Wow this answer is dumb. I apologize. I use Qt Creator, vim, Eclipse, and Microsoft Visual Studio.
superjoe30
+6  A: 

I believe KDevelop is what would be the closest from Microsoft Visual Studio. You get pretty much everything (except unfortunately VS debugger which is indeed a killer). Its already mature and its development is pretty fast and promising.

It actually implement a few stuff you won't even see in VS. For instance, open header file and cpp file in vertical tile mode, and have the cursor synchronized in both, ie: when you select a functions prototype, you always have its implementation on your right.

KDevelop is a KDE project, but run on Gnome. Anjuta is an equivalent project on Gnome, but I find it unusable for real work. For the rest of the stack gcc make valgrind ddd (a gdb IDE) and python for scripting my code.

If you're ok to try a different approach than the VS IDE. You may consider trying vim. It takes a long time to get used to it though.

poulejapon
QT has a new IDE out, that looks to be a Visual Studio competitor.
gbjbaanb
+14  A: 

g++ of course, but also Code::Blocks which is an absolutely fantastic cross platform IDE (Win32, *nix, Mac).

I use the nightly (more like weekly lately) builds from the SVN. It has almost all the bells and whistles you would expect from a modern IDE. It's really a truly fantastic Open Source project.

Also, on Linux you get the joy of using Valgrind which is probably the best memory tracker (it does other things as well) tool that money can buy. And it's free :) Track down memory leaks and more with ease.

And there is just so much more! Linux is such a great dev platform :)

(edit) Just realized you mentioned Valgrind in your question, silly me for reading it too fast.

Adam
I tried Code::Blocks but I didn't see anything great about it right off hand, certainly not compared to Eclipse. Can you expand on what you like about it?
Zan Lynx
I think Eclipse is too heavy weight. I love being able to compile a source file with out it HAVING to be in a project. I like that project files are light weight and unintrusive, unlike Eclipse where they are draconian dictators. I do like Eclipse's Source control, but C::B is getting that :)
Adam
A: 

Anjuta is a nice idea that makes Linux C++ dev quite enjoyable as well.

OJ
anjuta doesn't work very well.
superjoe30
+6  A: 

Eclipse CDT is really quite nice. I still have to resort to Emacs from time to time but I really love the indexing, call trees, type trees, refactoring support (thought it's nothing like Java refactoring), etc. Syntax highlighting is quite powerful if you customize it (can have separate colors for local variables, function arguments, methods, etc.). The code completion is really handy too. I've mostly used Eclipse 3.3 but 3.4 is great too.

Also, mostly I'm using this for a somewhat large project (~1e6 sloc) -- it may be overkill for toy projects.

Pat Notz
PS. Eclipse 3.4 and CDT 5.0.2+ is really solid. It's heaven for a large code base (my main project is in the millions of lines of code).
Pat Notz
I use CDT, too. There's a SCons builder plugin for Eclipsehttp://nic-nac-project.org/~lothar/eclipse/update/SConsBuilderPlugin.html
lothar
+3  A: 

When I developed C++ code on linux, I used emacs as an editor and as a gdb front-end. Later, my company purchased SlickEdit for all of the programmers, which is a nice IDE, maybe not on a par with Visual Studio. We used gdb extensively, with the occasional use of valgrind and gprof. I highly recommend using a scripting language to complement C++ on day-to-day tasks. I went from PERL to python to the current ruby. All of them get the job done and have strengths where C++ has weaknesses. And, of course, you have all the shell commands at your disposal. I daily use sort(), uniq(), awk, etc. And one more recommendation is ack, a grep successor.

Yuval F
I prefer Slick to VS, but that's if I turn a blind eye to the debugging capabilities, in which VS blows Slick out of the water. Other than that though. Your post is pretty much what I would've posted, except s/emacs/vim, of course. ;P
Bernard
Or is that s/vim/emacs? I think that one's right. I'm slipping! :o
Bernard
I believe s/emacs/vim, but then again, a vim expert would know that better than an emacs one ;-)
Yuval F
A: 

I'm another for KDevelop. It has a very diverse set of tools. I'm not real familiar with VS and whether or not it has integrated console access via its interface, but KDevelop can allow you to run a konsole inside the IDE, which I always find very useful. You could always give Netbeans a go now that it has full C/C++ support.

Other than that, I make good use of gdb and its gui-based version ddd for problems with the code or other bugs. For throw-away programs, like others that already posted - I use g++ at the terminal and make for some larger projects.

Patrick Loz
+9  A: 

When develop C++ apps for linux, i prefer using a bunch of cmdline tools. Vim extended with a lot of plugins. Gdb with ddd, valgrind, libefence and SCons (automake is a pain in ... you know where)

zhengtonic
what sort of plugins do you use?
phillipwei
For Vim -> NERD_tree.vim, a.vim, calendar.vim, code_complete.vim, cscope_maps.vim, taglist.vim
zhengtonic
A: 

Eclipse CDT for editing, SVN for source control, SCons for build management, CruiseControl for automated builds and a proprietary unit test framework.

lothar
+3  A: 

I use the NetBeans C++ plugin, which is superb and integrates with CVS and SVN. The project management side is also very good. I was up and running with it in minutes. It's an impressive IDE but being Java, can be a little sluggish.

Rob
+4  A: 

emacs, cmake, gdb, git, valgrind. It may not be as slick as Visual Studio but it works well, and it's easy to add functionality via bash scripting or emacs lisp.

thekidder
+1 with s/emacs/vim/; s/cmake/make/;
just somebody
After some years of trying differnt tools for Linux development, I really think you are using the best tool of its kind there.
kovan
+6  A: 

Right now I use the Qt Creator preview release (latest snapshot). I think it's worth keeping an eye on this one.

Edit: Fixed link. Creator is not a preview release any more :)

gnud
I love Qt Creator. Definitely a great up-and-coming IDE that integrates into my desktop very nicely.
Nick Presta
A: 

I use Eclipse+CDT on Windows and Cygwin + g++ to cross compile for Linux.

(Cross compilers are built using crosstool, a nice script-set for generating cross compilers)

rstevens
+7  A: 
  • g++

  • emacs

  • bash command line

  • gdb-mode in emacs (type M-X gdb)

  • make

Colin
If you added **ant** you'd be genius.
Carter Galle
+12  A: 

I use a bunch of terminal windows. I have vim running on interesting source files, make and g++ output on another for compiler errors or a gdb session for runtime errors. If I need help finding definitions I run cscope and use vim's cscope support to jump around.

Eclipse CDT is my second choice, but it's nice but huge, ungainly and slow compared to vim.

Using terminal windows and vim is very flexible because I do not need to carry 400 MB of Java around with me I can use SSH sessions from anywhere.

I use valgrind when I need to find a memory issue.

I use strace to watch what my software is doing on a system call level. This lets me clean up really stupid code that calls time(0) four times in a row or makes too many calls to poll() or non-blocking read() or things like calling read() on a socket to read 1 byte at a time. (That is super inefficient and lazy!)

I use objdump -d to inspect the machine code, especially for performance sensitive inner loops. That is how I find things like the slowness of the array index operator on strings compared to using iterators.

I use oprofile to try to find hot spots in optimized code, I find that it often works a little better than gprof, and it can do things like look for data and instruction cache misses. That can show you where to drop some helpful prefetch hints using GCC's __builtin_prefetch. I tried to use it to find hot mis-predicted branches as well, but couldn't get that to work for me.

Zan Lynx
Nice overview with good pointers and clear justification.
sototozo
+1  A: 
  • GCC
  • GHC
  • Vim
  • Cmake
  • cscope
  • GDB
  • Valgrind
  • strace
  • git

Is there really anything else you could possibly need?

greyfade
+1  A: 
  • Bash
  • Vim
  • Make
  • G++
  • GDB
  • Valgrind
  • Gprof
  • svn

Never a GUI to be seen except a good terminal with tab support; keep code, debugger, output, etc all in separate windows and tab back and forwards really quickly.

Adam Hawes
+1 except s/vim/gvim/, that's a GUI with some value in it (but to be honest, i've used vim in a black-and-white terminal some 8 years ago, and the things it would do then in the syntax highlighting department keep amazing me to this day)
just somebody
+1  A: 

In addition to many already listed, we use the autoconf toolset for deploying our program to users.

Scottie T
used within RPM or not?
Carter Galle
@Carter Galle: autotools are orthogonal to packaging systems
just somebody
+1  A: 
  • CMake
  • vim
  • g++
  • kdevelop (compiled from SVN daily!)
  • Mercurial when I can, SVN when I have to, git when there's really no other choice (contributing to project that uses it)
  • valgrind
Nicolás
http://hg-git.github.com/ should eliminate the cases "*when there's really no other choice*"
just somebody
+2  A: 

You need a standard toolchain + an IDE.

There's nothing much to say about the standard toolchain. Just install e.g. on Ubuntu/Debian via

aptitude install build-essential

The interesting part is about an IDE.

My personal impression is that nowadays - in the 21th century - vi/emacs/make/autotools/configure is not enough for developing software projects above a certain size (... and yes, please please please blame me for the heritage heresy ...).

Which IDE to choose is simply a matter of taste. You will find a lot of threads on SOF. Here is a permalink discussing which C++ IDE might be the "best": C++ IDE for Linux.

what's your heritage? Visual Studio 6.0? -1 for the "absolutely need an IDE", refundable on change to "relatively". ;)
just somebody
Arrrgh - I used the wrong word. I thought that "heritage" is a very sophistacted way to express "blasphemic". Next time I will consult my german-english dictionary before posting ;)
@just somebody: you are right regarding "absolutely need an IDE". I have changed the wording.
A: 

Mi first choice is allways emacs with a lot of plugins: ecb gives some buffers to navigate on the folders, gdb, svn or git integration... This is mi first choice using Python too.

As a second choice, Netbeans with C++ plugin, is very simple and quite powerfull, but too heavy I think.

pyriku
A: 

I use whatever is on the system. I prefer Eclipse CDT as an editor, and g++ as a compiler. However, if eclipse is not an option I use vi, which is fine as well.

Vladimir Kocjancic
A: 

The Eclipse incubation project Linux Tools integrates C/C++ Development tools. It's a GUI plugin to integrate tools like Valgrind, GProf, GCov, SystemTap etc into the Eclipse C++ CDT IDE.

Search for Eclipse Helios IDE for C/C++ Linux Developers (includes Incubating components), (120 MB)

Found this after trying to build Linux Tools using the .psf file available. Thankfully found this package hiding right at the bottom of the Helios packages download page.

Note that this is an incubation project so you can expect the support to only get better with time.

See Also: For updated info on installing and using Eclipse Linux Tools Click Here

GuruM