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