Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

In the next month I have to shift to work on the ubuntu system and writing c/c++ programs. I used to program in windows visual studio for some years.

What should I do to prepare the shift suddenly? And how to debug in that system?

share|improve this question

closed as too broad by MichaelT, Snowman, gnat, ratchet freak, Ixrec Apr 24 at 23:21

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

If you miss visual studio, check out KDevelop –  Malfist Dec 31 '10 at 16:55

7 Answers 7

One of the most efficient C/C++ development environments are Emacs, which at least should be considered by anybody in your situation.

  • It interfaces nicely with gcc output giving easy compilation error corrections.
  • It interfaces nicely with gdb giving easy debugging of programs.
  • Runs both in a graphical session and over a ssh-connection to a remote computer.
share|improve this answer
The other largest Unix/Linux editor camp is Vi/Vim, of which I strongly recommend you learn the very basics of vi, but use vim if you prefer its modal command style. Emacs has a steep learning curve compared to other editors, but it is incredibly powerful. –  mctylr Dec 31 '10 at 19:31
Does Emacs give you project management and error line highlighting like most IDE's? –  TheLQ Jan 1 '11 at 5:47
@TheLQ, what is "project management"? Emacs allows you to jump to the errors indicated by the compiler one by one. –  user1249 Jan 1 '11 at 11:19
Coming from Visual Studio, I think that a switch to Emacs or Vim might be rather jarring. –  Davis Gallinghouse Jan 1 '11 at 22:19

I believe the majority of Unix / Linux programmers still tend to use the mix of editor (vim | emacs), make, and gcc/gdb for C and C++ programming. Well, at least I do.

The two most common C libraries are the Standard C Library (normally glibc for Linux), and POSIX (IEEE Std 1003.1-2008) / Single Unix Specification from , IEEE, and Austin Group.

The two most popular Unix programming reference books are Advanced UNIX Programming by Marc J. Rochkind and Advanced Programming in the UNIX Environment, 2nd edition by (the late) W. Richard Stevens and Stephen A. Rago.

Learn how to write Makefile's and life without an IDE will seem sane. But bear down and learn autotools if you need to support multiple Unix/Linux platforms.

I also recommend cppcheck and valgrind as additional development debugging tools.

I am not familiar with the IDE options enough to recommend, but I believe Eclipse, NetBeans, and KDevelop each have their followings and I believe are still be maintained / developed.

share|improve this answer
+1 for Advanced Programming in the UNIX Environment this is an excellent book. –  Alos Jan 5 '11 at 18:48

Learn your new tools. And if you can choose them yourself, test out a bunch of IDE's and find the one you like the best. With a good integrated IDE, the shift will not be very brutal, and you debug as you do in Visual Studio (but with other key-combinations and other minor differences).

You can in Unix develop by using vi or emacs and command line tools like gdb etc, and you find many experienced programmers doing that, but that's a much bigger step than just switching to a new IDE.

share|improve this answer

Have a good look at command line tools: make, m4, sed, grep, perl

Read up on the design of Unix-like operating systems; the everything-is-a-device concept which is quite different from the windows approach, the filesystem and the tools-connected-by-pipes way of combining tools.

Debugging is done with gdb which can be used from within editors like emacs to give a nicer debugging environment. It does pay to learn the gdb commands so that you can use them from a termimal session too.

share|improve this answer
Everything is a file, not everything is a device. (Also note that there are exceptions, like network devices) –  Kristof Provost Dec 31 '10 at 21:07

Be sure to understand make and makefile dependencies. The syntax will bug you, but understanding the way stuff that is needed is pulled up and changed files cause recompilation will really help. Trust me, on any C/C++ based code above a certain level of complexity, this is vital.

share|improve this answer
+1 for understanding make. The tab/spaces thing in the Makefile probably deserves mention as well. –  Larry Coleman Dec 31 '10 at 22:27

I found that Netbeans is quite a robust IDE for C/C++ in Linux (also used it in Ubuntu).

  • Debugging is really usable and comprehensible.
  • Autocomplete is nice and quick.
  • Custom compiling directives can be added with no hassle in the project's properties.
  • You can easily get it from the Synaptic package manager.
  • And best of all: not having to compile from the command line.

Also, I'd start thinking in portability:

  • Check Cygwin so you can use most linux libraries in Windows.
  • If you are going to do GUI development, check wxWidgets.
share|improve this answer
+1 for mentioning NetBeans, I also find it a decent IDE for Linux and C++. But I'd also say that one should not rely completely on it. It's a great IDE for cross-references, code completion, auto-generation tools, debugger, but one still have to know make, gdb, and a source-control CLI commands. –  Sorantis Dec 31 '10 at 17:39

I have to echo @Malfist's comment about KDevelop. It's by far the best IDE I've used. It's extremely powerful for C/C++ development and the IDE features such as code coloring and such are great and actually something I really miss in Eclipse for java/python.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.