Setting up a Programming Environment in Linux [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I recently started using Linux as my primary OS. What are the tools that I will need to set up a complete programming environment in Linux for C and C++?

Standard stuff:
The compiler tools, gcc, gdb, etc.
Some sort of editor/IDE (emacs, vim, eclipse)
Profiling tools
Source Control (SubVersion, git, etc)
Language specific tools, like easy_install for python (you said C/C++, but the same goes for everything)
A web server maybe? Apache, Lighttpd, nginx
Any libraries you'll be using. Are you doing kernal hacking? Driver development? opengl?

Among others you should also have gprof and valgrind ( or something in it's class ).

Vi (or emacs), gcc , make
Tradiationally unix development is more commandline than ide. There are very good IDEs, the main ones are probably eclipse and kdevelop

It depends on your definition of "Complete programming environment", and whether you are using C, C++, or both (C/C++ is an awful term that shouldn't be used. Either it's C, or C++).
If you are looking for an IDE, Eclipse/CDT is the most highly-recommended one from my experience (I don't actually use any IDE, so I can't offer first-hand advice).
If you can cope with command-line control (and in the end I find it makes things easier to do and doesn't take a whole lot of getting used to), a simple text editor with highlighting will suffice. I prefer KATE (part of KDE), as it features a built-in terminal as well as many features you would expect from an editor inside an IDE, like code folding and regex search/replace.
Many people also recommend Vim or Emacs, both of which are probably available through your distro's repositories. (Eclipse is probably available too, but in my experience the CDT is confusing to install via packages. YMMV). They are both ancient editors; and there is a powerful holy war between the two, so I won't get involved.
Your compiler should probably be GCC - on a Debian system, installing the g++ package as well as build-essential should be enough to get C++ going (build-essential should contain the gcc package required for C development). Whatever your distro, GCC is probably easily available or else already on your system.

Seconding swilliams, I'd say the basics are:
an editor or IDE (I use vim),
a compiler (almost certainly gcc)
make, or maybe some other similar tool like ant if you want
a debugger (almost certainly gdb)
source control (I use subversion)
Standard unix utilities like grep and diff, but you have those already
Other than that, I'd say install as you go. Linux is more about little utilities that each do one thing than monolithic development environments that do everything. So if you find yourself needing something, you can always just install it, be that thing a memory profiler, a documentation generator, a bigger/smaller/more different editor, et cetera, et cetera.

What distribution are you running?
In Ubuntu or any Debian based distribution you can issue the following command to install all the necessary tools.
sudo apt-get install build-essential
From there you can install your SCM solution of choice and an IDE if you prefer or just use your favorite text editor.

The simplest of answers is an editor (take your pick - at least one is already on there) and gcc/g++.
If you want an IDE, there are a slew of questions related to that on SO :) (including this one C++ IDE for Linux?).

Kdevelop is a well regarded and well written IDE for Linux, installing it should get you every other tool you might want to develop with installed as well and and IDE to go with it.
By "every other tool" I mean gcc, grep, diff, autoconf et al should be grabbed by the package manager and installed at the same time, but I could be wrong. I don't have a standard distro on hand to test that with.
Personally, I use vim, but I have used kdevelop in the past.
vim/vi is handy because you know that some form of vi is always available on every unix platform.
I have to correct my post. I just looked at the package requirements for kdevelop on ubuntu... it does NOT appear to require gcc and install it automatically

If you want something very easy to use, with ability to import visual studio projects, and a feel much like VS, give Codeblocks a try. Its quick ( since its not Java based ) and in general works well.

Another great utility that you can use are *nix man pages. Each function in the C library has an associated man page.
For example:
man printf
man strncpy
...

I took an old windows laptop with a dead hard drive and
replaced the hard drive then installed Ubuntu (linux / debian
all in one handy release) on it. I had to burn the ubuntu
installation files onto a cd first on another working computer.
Here's where I got my linux from (complete with desktop gui, very
easy to install, lots of programs to use, it was my first linux
but not my first unix):
http://www.ubuntu.com/getubuntu/download
Then i installed Netbeans for my integrated development environment (IDE)
altough I am using it for java -- but it comes with c++ support as shown below:
http://www.netbeans.org/features/cpp/
I also installed mySql, you didn't ask, but that is another key component
that completes my development environment.
Good luck to you.

On most distros, everything you need will be installed by default (very few don't include gcc, they all include some kind of editor). I generally do my development in Vim (or gVim, which is the graphical version -- the best of both worlds). For those times when I'm feeling the need for a "real" IDE, Eclipse with the Vim plugin is really nice. It's almost like working in Vim, except you get the Eclipse stuff -- again, best of both worlds. The Vim plugin for Eclipse that I'm using is not free, however :( I believe there is a free one, but the last time I tried it, it wasn't very good.

Personally I use Ubuntu w/ Eclipse CDT. Eclipse is what most people might think of as a Java IDE, but CDT is a set of extensions that really tune it for C/C++ development. It's smart enough to figure out what toolset to use (MacOSX GCC vs Linux GCC, for example).
Eclipse CDT Website
For best results, currently the 6.0 JRE for Ubuntu seems to have problems with recent Eclipse versions, so what I did was remove the 6.0 JRE and run:
apt-get install build-essential
sun-java5-jre sun-java5-bin
Then grab the latest Eclipse from the website, unpack it in a directory.
As a final touch, edit the eclipse.ini file that comes with Eclipse and add this line to it:
-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
This will further stabilize the app, making it as rocksolid as Windows or Mac.
If you prefer commandline tools over GUI tools, some ones I use regularly:
CMake -- Portable build tool. It's easy to use and can output a variety of formats like Makefiles or Visual Studio files.
apt-get install cmake
Vim -- VI improved, if you want a text editor with some bells and whistles. Otherwise, just use 'nano', which comes with Ubuntu.
apt-get install vim

Twe options, you must make your decision now and never look back, or risk being burned at the stake:
a. Emacs
b. vi(m)
Do not listen to any rational arguments before choosting... listen to the light inside yourself...

Install a lot of bell a whistles for the editor you choose, vi is usable but no fun.
vim is fun, but vim with extras is great.
(And the same is true for Emacs even if that means installing tetris and a doctor ;-) )
/Johan

Two must haves are guake and pithos. I cant see how any one can have a list of dev tools without these.

Related

Installing OCaml

I would like to start programming in OCaml. As I am a Windows user, I understand that it is preferred to do so using the OCaml plugin for Netbeans.
I have downloaded the aforementioned plugin from the following link: http://ocamlplugin.loki-a.com/ocamlplugin/updates/ . I have installed the plugin into Netbeans as instructed. I managed to open a project but even the sample "Hello World" won't run.
I then tried to install the OCaml IDE from here: http://ocamlplugin.loki-a.com/index.php?title=Main_Page#Download_2 , but it still wouldn't run anything.
I am not interested in working with Eclipse because that would include downloading Cygwin.
I would appreciate a simple solution. Thank you! :)
I would suggest OCaIDE under Eclipse, if you stick to Windows anyway.
But I don't understand your reluctancy to use cygwin, especially when there is such nice step-by-step tutorial for configuring cygwin for OcaIDE and Eclipse.
Another option, which I haven't tried but would strongly suggest you trying, is Sublime Text 2. It supports OCaml and is a very popular cross-platform text editor. But since I haven't tried it, I would not be able to provide you with details about it. Although it comes with a cost, you can evaluate it for free without time limit.
TypeRex has been my favourite for OCaml so far, and you can now use Emacs in Windows, so with some workaround in cygwin you can use TypeRex in Windows.
Another option is to use VirtualBox, install a normal linux distro and use Typerex+Emacs inside it. It is also not complicated, as it takes 1 hour to config at most.
The ocaml links that you gave have not been touched since 2009 (4 years ago). That probably means the odds of them running with the current NetBeans are equivalent to the proverbial sphere of solidified water in the Christian place of eternal theological punishment.
Since you are asking about running under Cygwin, it sounds like you want a Linux version of Eclipse as well. Eclipse runs quite well under Win7, at least, and under Mint (I use them under both) However, all my attempts to get ANY OCaml IDE running under either system have been borged (resistance is futile, and depends and capacitance anyway).
So, under Mint 15, emacs and vim (the old standards) work well as text editors. I wish I could suggest anything else.
Good luck!!!
By now, another option has appeared for Windows 10 users wanting to use OCaml: the Windows Subsystem for Linux.
Basically, what it does is that it allows you to run Bash and any non-GUI Linux program on your PC. Once installed, you can install OCaml and OPAM with apt-get and you're good to go.
As far as I am concerned, I use Windows 10 on my desktop PC, and I haven't had any inconvenience with WSL yet.
I personally use Merlin/... which is are plugins for emacs. But I can understand that you dont want to use emacs. I have been told that the support with Visual Studio Code is supposed to be quite good, especially when using it together with the builtin console. Also for smaller things there is Ocamltop but I have now idea how the Windows support is. In the end I suggest, using the Linux Shell on Windows as RichouHunter suggests.

Learning Linux from Windows Newbie questions [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am a newbie in linux and programming. I want to learn linux command and use create some C and C++ programme to interact with the linux API from my windows XP. However, I am not sure how to set up the environment from my windows based computer.
What programme should I install? Also, it seems like linux has Ubuntu, Fedora. I heard of Red Hat as well. What is the difference and which one should I install?
Also, is there any difference between using linux with user interface like Ubuntu, using an IDE to create programme AND the command line terminal using VIM to create programme?
Besides, I have heard of using Valgrind to debug programme. Does Valgrind works together with an IDE in Ubuntu or works in command line terminal only? If my IDE already has debugger, do I still need Valgrind?
Sorry for such newbie questions.
Thanks.
Your question is very vague and prone to start argumentations and fights. Also, you miss-used many terminologies there and before you even start programming with Linux, you should first get acquainted with the OS, especially the terminal... But first things first, programming in C/C++ for Windows is not entirely the same as programming in C/C++ for Linux. If you want the latter, then use the latter.
My suggestion is this :
Grab VirtualBox and install it.
Download Ubuntu ; IMHO, Ubuntu is best for starters (or anyone as a matter of fact) because it has a lot of support, a good user base and is compatible with pretty much any Linux software installer (RPM, deb, etc.) You can choose any other distribution, it doesn't really matter, but I recommend this one. [1]
Start VirtualBox and create a new Ubuntu virtual machine. The steps are pretty straight forward, consult the documentation for any assistance). Your virtual machine may look something like :
1GB of RAM will be enough;
10GB of hard disk (you won't need much more, but you may increase the size if you think you'll need more space for /home, see next point)
a network adapter set a bridged
etc.
Install Ubuntu from the ISO that you have just downloaded (that you have mounted into VirtualBox as a CD-ROM device) You'll only need about 8GB of hard disk total for a typical, minimum Ubuntu installation (ext4+swap), however I recommend this setup.
Enjoy your installation. (Tip: now you can install the VirtualBox's Guest Additions.)
Open a terminal in your Ubuntu VirtualBox window and type sudo apt-get install build-essential to install the GCC compiler
Gedit is already installed by default with Ubuntu and it's a fairly good text editor compared to Windows' notepad. However, vim is not, but you can install it with sudo apt-get install vim in the terminal.
And voilà! You're all set to go to do some C/C++ programming in a Linux environment, where you can still have Windows in case you're stuck.
I also recommend you do most of your learning using the terminal (aka the command line) so you know how things work under the hood. Then, when you are familiar with the GCC compilier, MAKEFILEs, etc. you can install some IDE to avoid repeating tasks; The two best I have yet found are Ajunta and MonoDevelop. Both are available from the repositories.
Now, if you want to "create some C and C++ programs to interact with the linux API from [your] windows XP", You need, for example, to learn sockets and SSH; so you can connect to your Linux machine from your Windows machine and execute some commands remotely from your Windows applications. But before you do that, learn C/C++ and play around with Linux. For a newbie, you already have your hands full right there.
Good luck!
[1] Ubuntu (a Linux distribution) comes with Gnome as GUI, while Kubuntu with KDE and Xubuntu has XFCE. All of them (GUIs) are separate projects and you could have all of them installed on any Linux desktop installation. Even, you don't need any GUI with any Linux distribution; for example, VMWare's Virtual Appliance Marketplate have a whole bunch of ready-to-go Linux installations like that.
Try it with a VM or as a live-cd.
Valgrind is a command-line tool but maybe some IDEs use integrated it.
Under Linux you'll see, than most of the time an IDE is quite useless (not a troll).
You'll do your Makefile manually,...
Hope you'll enjoy' it.
Regards,
Learn 1 thing at a time.
If you want to learn to program first, try python first. It works in Windows and Linux and you get result faster
If you want to learn C++, get Visual C++ express or Cygwin/GCC
If you want to experience with Linux, get a distribution of your choice (Linux-Mint is a good introction, coming from Windows) and try it in a VM (VMWare Player or VirtualBox)
Try easy projects and only after that, worry about debuggers
If you try it in virtual machines (virtualbox or WMWare for example) you can test as many options you want before deciding what Linux distro you will want to use. There are a lot, but from what you listed, my personnal opinion is that Ubuntu is a lot easier than Fedora to start. I've never used RedHat so I can't tell but it hasn't the reputation of beeing a hard one (for experts).
Anyways, at least to start I recommend installing it with GUI (and after starting too unless it's a server...).
Regarding IDEs, you could try Eclipse and Netbeans. They run both on Windows and Linux but I'm not C/C++ programmer so I don't know if they are good at that job. I you don't use IDE, Vim is far from beeing the unique option (Vim "addicts" :) will say it is the unique productive one but that's a personnal choice and the learning time is not very short). Personnaly I prefer a good IDE or at least graphical editors for programming, not that I don't like the power and speed of the terminal with command line as I prefer to use it for system administration or configuration but not for programming where you stay a long time on it.
I don't know about Valgrind but Eclipse or Netbeans IDEs have debuggers of course.
Programming for Linux a series of projects to learn, for the steps, you may refer to:
Red Hat Certified System Administrator I &II student-book which may help you to get the survival abilities in Linux, actually when you really understand the fields covered by these courses, you will have got the ability to find what to learn.
Search amazon with keyword 'Linux Programming', choose one and start your journey.
Have a good time.

Ubuntu desktop development environment (GNU tools)

I am setting up a Linux development machine (Ubuntu 9.0.x).
I want to know the best development environment for a C++ developer on Ubuntu - giving my background (see below).
5 years+ C++
5 years Visual Studio
Not much experience using GNU tools (GCC, GDB, make, etc.)
6 months or so of using Emacs at university (about 8 years ago!) - I don't remember anything though ;)
I come from a Windows background so am more at ease with GUI than CLI, although I expect to learn the CLI commands over time. I want to be effective and "hit the ground running" as it were, in terms of developing on Linux.
I am particular interested in tools that will make my life easier for:
1). project management
2). build configuration via GUI (rather than makefile editing - at least for now).
3). debugging IDE that allows me to set breakpoints and step in/out/over
It would be useful if the IDE suggested has a GUI to ease my transition to Linux, but is also customisable (e.g. can accept hand crafted edited make files etc. - when I have learnt how to create them). This will allow me to have more control over the build process later on.
Which set of tools would you recommend in order for me to achieve the maximum productivity in the minimum amount of time on my Ubuntu desktop?
So:
Which application (IDE) offers:
(i). easiest transition from Visual Studio (and ideally can use manully crafted make files)
(ii). extensive debugging capability akin to Visual Studio
for the latest Ubuntu (9.0.x) desktop OS?
As for C++ developing I'd choose Qt Creator IDE for easiest migrating from Visual Studio. I believe it can cover all your needs.
The best tools that you need are:
make
gcc
g++
Your Favorite Text Editor
auto-tools
Qt Creator
Glade
Your Favorite Project Manager
For Ubuntu I suggest you to use Glade, because Ubuntu uses Gnome(GTK).
About IDEs:
Eclipse For C/C++
Netbeans For C/C++
Code::Blocks
Kdevelop
I think you should just bite the bullet and learn enough make, gcc, and gdb to accomplish what you need to do at the command line. If you get that taken care of, you can use whatever editor you like to write the code -- even Visual Studio's editor.
Have a look at Code::Blocks. It's a nice IDE for doing C/C++ and comes with an own build-system. But be sure not to grab the version inside the official ubuntu repository but go to the CB forum and look for the latest nightly build. There are people maintaining repositories with ubuntu packages. I think CB is worth the hassle of installing the latest version.
Link to Code::Blocks Forum
Btw. I did an install some days ago. There are two people maintaining 64-Bit Ubuntu packages. Only one did work, though. It was this one.
You can use Glade Interface designer (glade.gnome.org) for interface design.
BOUML for UML modelling & project management
You can always use eclipse or netbeans for c++ development on linux.
Though I recommend Eclipse, it would automatically generate makefiles, debugging is very easy & you can configure your code repositories within the IDE.

C++ IDE on Linux [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
We trying to choose an IDE for C++ development on Linux.
The proposed options are KDevelop and Eclipse.
Eclipse is highly customizable, but Java centric and heavy.
KDevelop is bounded to particular KDE (I believe because KDE API) and can not be replaced if required.
What you use and why?
Thanks
Dima
KDevelop, because:
It supports CMake.
It fully integrates with the GCC utilities.
It has a good syntax highligher and code editor
It has a relatively quick startup time and is relatively light weight.
Since you are comparing KDevelop with Eclipse, let me also point out that:
KDevelop uses a file for its projects, so you can open the project file in your file manager. By contrast, Eclipse stores metadata in folders, so you need to open your Eclipse project by running Eclipse.
Because KDevelop stores its information in a single project file, whereas Eclipse uses lots of hidden metadata, KDevelop leaves your code folders much cleaner than does Eclipse.
KDevelop will never attempt to delete files on your filesystem, unless you specifically ask it to do so. By contrast, it is very easy to accidentally harm files on your filesystem using Eclipse.
Also, when I've used KDevelop, I've been using it on Ubuntu which uses the Gnome desktop. On Gnome, KDevelop still beats Eclipse in terms of startup time, and is definitely worth using.
Also, one last note, if you use CMake with KDevelop, then you can distribute your source code to users on Windows, Mac, and Linux, and they will be able to compile your source code, even if they don't have KDevelop; CMake can generate a native Makefile, a Visual Studio project, an Xcode project, or a KDevelop project. So, the concern that you can't replace KDevelop really doesn't apply if you use the CMake backend.
I use Qt Creator, which is excellent if you're considering using Qt. I've found the C++ tools for Eclipse work well though - editor seemed solid, debugging "just worked", so I was happy!
I use Eclipse and like it quite a lot. The CDT plugin makes the interface much more c++/C friendly and the extensibility of Eclipse with other plugins makes it a "one-stop-shop" IDE for many needs. I use it for PHP, Perl, C++, Database work, and ColdFusion.
One of the best things for Eclipse IMO, is the Mylyn Plugin. Task based filtering has been a wonderful addition to my work flow.
Emacs :)
Customizable beyond your wildest dreams. (And you can play tetris while code compiles)
Have tried, codeblocks, netbeans and eclipse with c++ support and qt creator.
Netbeans and eclipse work just fine, but their default window layout and editor settings make me "sick" each time when I install them as one needs to remove/minimize change fonts, size etc in order to make it somewhat readable as the default settings are just covering too much of the screen. It's java based and somewhat laggy on my laptop running ubuntu (different versions over the years) on a cd2 2.2ghz with 2gb ram. I have no idea as to why since I completely reinstalled the distro's several times. That slow and sluggish feeling when one opens the debugger and it slowly crawls through the code is the worst. Same when you are manually going through the function calls (clicking like mad and controlling values), and if you do that a lot (big project) the IDE will totally slow down making you wait 3-5 sec after each press of the button.
Netbeans especially seems to have something against ubuntu as sometimes it will not scale the windows accordingly and some settings will overlap each other. Very irritating.
Code Blocks with the nightly build works best right now in my opinion of those 4 as you can just install and start working without need to fix the font/size, windows etc. It is also the fastest IDE of those I have tried in building / cleaning projects and responds fast when opening/closing prjects, starting program.
Qt creator is like an "mac app". It looks visually very nice, it's simple to use but then again I just dislike when I need to debugg in it. It just doesn't have some of the options that other IDE's have. If you are however developing UI then I highly recommend it because of it integrated gui layout designer.
The Eclipse version that I was using was 5 months old, netbeans 2 months, Qt creator 5 months old and Code Blocks only 20days as I regularity update the nightly builds every month.
If you have not guessed it by now, its Code Blocks that I'm using on my ubuntu distro.
Then again the biggest disadvantage with these IDE's when comparing to the VS2008 that I also use is the debug part. VS just has everything done nicely and you can see the values in vectors, strings etc just by hovering the mouse on the code. When looking inside structures you also skip all the "unnecessary" information so that you dont need to press on like 5 "pluses" and expand the lines in order to see what is saved in a vector.
These were my "daily experiences" with those IDE's on linux as I believe they are important than just listing different features that each IDE has. Everything else seemed to work fine (and I haven't really tested every single feature in great detail). Hope that this will at least help somewhat in deciding what you will pick.
Having said that, Kdevelop you are next on my test list as I haven't tried it yet.
Not a classic IDE but emacs or Xemacs works well as an IDE on linux given that it can be set up with integrated build and debugging.
Code Blocks is an option
I think the correct answer is to try both (and maybe others) for yourself. Personally, I've used Eclipse for the past ~3 years. I'm satisfied with it but there are parts that I think could be better.
But, I think your best bet is to install both and try them each for a week or 2 (maybe longer). A lot of this comes to do personal preference and taste. This is the 2009 version of the vi or emacs question :)
I use CDT on eclipse I find it very responsive.
Plus plugins like Subclipse, Mylyn etc really make development a lot easier.
I use Java and C++ together is some projects so the fact I can code Java/JNI/CPP in the one IDE makes life a lot easier in my opinion.
If you are looking for light IDE you can try vim. With appropriate plug-ins and skills it might be very powerful.
QtCreator
Eclipse
Netbeans
KDevelop
Each has strengths and weaknesses, and it'll depend a lot on on what else you're doing.
You can also try Anjuta (good for GTK environments) or Geany.
I have been using QtCreator.
Nice and clean interface (seems snappier than Eclipse - though I have not used it in a while) and supports debugging.
Geany \M/

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

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
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?
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.
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.
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)
g++
emacs
bash command line
gdb-mode in emacs (type M-X gdb)
make
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.
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.
g++ and make
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.
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.
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.
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.
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.
GCC
GHC
Vim
Cmake
cscope
GDB
Valgrind
strace
git
Is there really anything else you could possibly need?
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.
In addition to many already listed, we use the autoconf toolset for deploying our program to users.
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
Anjuta is a nice idea that makes Linux C++ dev quite enjoyable as well.
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.
Eclipse CDT for editing, SVN for source control, SCons for build management, CruiseControl for automated builds and a proprietary unit test framework.
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)
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.
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.
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
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.