What tools do you use to develop C++ applications on Linux?

C++LinuxEclipseGdbValgrind

C++ Problem Overview


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?

C++ Solutions


Solution 1 - C++

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. 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.

Update: I've found that perf works way better than oprofile. At least on Linux. Learn to use perf and love it as I do.

Solution 2 - C++

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.

Solution 3 - C++

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)

Solution 4 - C++

  • g++

  • emacs

  • bash command line

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

  • make

Solution 5 - C++

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.

Solution 6 - C++

Right now I use Qt Creator. It's cross-platform and integrates pretty nicely with Qt, though (of course) you have the option of creating a standalone application.

Solution 7 - C++

g++ and make

Solution 8 - C++

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.

Solution 9 - C++

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.

Solution 10 - C++

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.

Solution 11 - C++

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.

Solution 12 - C++

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.

Solution 13 - C++

  • GCC
  • GHC
  • Vim
  • Cmake
  • cscope
  • GDB
  • Valgrind
  • strace
  • git

Is there really anything else you could possibly need?

Solution 14 - C++

  • 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.

Solution 15 - C++

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

Solution 16 - C++

  • 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

Solution 17 - C++

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

Solution 18 - C++

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.

Solution 19 - C++

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

Solution 20 - C++

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)

Solution 21 - C++

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.

Solution 22 - C++

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.

Solution 23 - C++

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

Solution 24 - C++

FlexeLint for static code analysis, in addition to mentioned above:
Eclipse with CDT, gcc, make, gdb, valgrind, bash shell.
Source version control: Clearcase or git, depending on project.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionClaytonView Question on Stackoverflow
Solution 1 - C++Zan LynxView Answer on Stackoverflow
Solution 2 - C++AdamView Answer on Stackoverflow
Solution 3 - C++zhengtonicView Answer on Stackoverflow
Solution 4 - C++PaulView Answer on Stackoverflow
Solution 5 - C++thekidderView Answer on Stackoverflow
Solution 6 - C++gnudView Answer on Stackoverflow
Solution 7 - C++andrewrkView Answer on Stackoverflow
Solution 8 - C++fulmicotonView Answer on Stackoverflow
Solution 9 - C++Pat NotzView Answer on Stackoverflow
Solution 10 - C++Yuval FView Answer on Stackoverflow
Solution 11 - C++anonView Answer on Stackoverflow
Solution 12 - C++RobView Answer on Stackoverflow
Solution 13 - C++greyfadeView Answer on Stackoverflow
Solution 14 - C++Adam HawesView Answer on Stackoverflow
Solution 15 - C++Scottie TView Answer on Stackoverflow
Solution 16 - C++NicolásView Answer on Stackoverflow
Solution 17 - C++OJ.View Answer on Stackoverflow
Solution 18 - C++Patrick LozView Answer on Stackoverflow
Solution 19 - C++lotharView Answer on Stackoverflow
Solution 20 - C++mmmmmmmmView Answer on Stackoverflow
Solution 21 - C++pyrikuView Answer on Stackoverflow
Solution 22 - C++Vladimir KocjancicView Answer on Stackoverflow
Solution 23 - C++GuruMView Answer on Stackoverflow
Solution 24 - C++David KhosidView Answer on Stackoverflow