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

66,843

Solution 1

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

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

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

  • g++

  • emacs

  • bash command line

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

  • make

Solution 5

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.

Share:
66,843
Clayton
Author by

Clayton

Software Engineer in San Francisco, CA

Updated on July 09, 2022

Comments

  • Clayton
    Clayton almost 2 years

    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?

  • andrewrk
    andrewrk over 15 years
    anjuta doesn't work very well.
  • Tom Duckering
    Tom Duckering over 15 years
    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
  • Tom Duckering
    Tom Duckering over 15 years
    Or is that s/vim/emacs? I think that one's right. I'm slipping! :o
  • Yuval F
    Yuval F over 15 years
    I believe s/emacs/vim, but then again, a vim expert would know that better than an emacs one ;-)
  • Pat Notz
    Pat Notz over 15 years
    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).
  • Zan Lynx
    Zan Lynx over 15 years
    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?
  • Adam
    Adam over 15 years
    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 :)
  • gbjbaanb
    gbjbaanb about 15 years
    QT has a new IDE out, that looks to be a Visual Studio competitor.
  • Nathaniel Sharp
    Nathaniel Sharp about 15 years
    I use CDT, too. There's a SCons builder plugin for Eclipse nic-nac-project.org/~lothar/eclipse/update/…
  • Arafangion
    Arafangion about 15 years
    And you do your editing with 'cat', I presume?
  • andrewrk
    andrewrk about 15 years
    Nope, I use a remote desktop connection to my windows computer and use eclipse to write code, then copy and paste it into g++
  • phillipwei
    phillipwei almost 15 years
    what sort of plugins do you use?
  • zhengtonic
    zhengtonic almost 15 years
    For Vim -> NERD_tree.vim, a.vim, calendar.vim, code_complete.vim, cscope_maps.vim, taglist.vim
  • Nicolás
    Nicolás over 14 years
    I hope you're joking o_O
  • NVRAM
    NVRAM over 14 years
    If you added ant you'd be genius.
  • just somebody
    just somebody over 14 years
    +1 with s/emacs/vim/; s/cmake/make/;
  • just somebody
    just somebody over 14 years
    @Carter Galle: autotools are orthogonal to packaging systems
  • just somebody
    just somebody over 14 years
    +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
    just somebody over 14 years
    hg-git.github.com should eliminate the cases "when there's really no other choice"
  • sototozo
    sototozo over 14 years
    Nice overview with good pointers and clear justification.
  • Yavor Angelov
    Yavor Angelov over 14 years
    I love Qt Creator. Definitely a great up-and-coming IDE that integrates into my desktop very nicely.
  • AntonioMO
    AntonioMO over 14 years
    What about a magnetized needle and a steady hand?
  • andrewrk
    andrewrk over 14 years
    Wow this answer is dumb. I apologize. I use Qt Creator, vim, Eclipse, and Microsoft Visual Studio.
  • kovan
    kovan over 13 years
    After some years of trying differnt tools for Linux development, I really think you are using the best tool of its kind there.
  • Adri C.S.
    Adri C.S. about 11 years
    Same here as @justsomebody :D
  • Jérôme Radix
    Jérôme Radix about 9 years
    lint, cflow, gprof, unifdef