tags:

views:

133

answers:

4

I have years of C++ programming experience in Windows. Now I need to program some applications for Linux. Is there any resource that helps me quickly get the required information about Linux technologies available to C++ developers?

+3  A: 

I'm in the process of making the switch from Windows to Linux right now for a program and so far I have found that man and grep are great. Instead of looking up function prototypes in MSDN (or similar) I just use man.

If I need a code example, greping through an existing project that has some similarities to mine is a great help. Or if there is a project similar enough to warrant this, setting up an LXR of their code-base to more easily facilitate reading really helps a lot.

In general, the open source nature of Linux has been the greatest resource to learning to program on Linux.

Also Stevens' Advanced Programming in the UNIX Environment was a huge boon. But as for IDE's and the like, call me a luddite, but I just like vim and make.

mrduclaw
LXR: http://en.wikipedia.org/wiki/LXR_Cross_Referencer
Peter Mortensen
+1  A: 

I use die.net and lookup at The Open Group's website a lot, http://www.opengroup.org/onlinepubs/000095399/functions/{function}.html. They have much the same information as man. I use SciTE, and have the C API and The Open Group POSIX lookup as hotkeys, as described here.

Pete Kirkham
+2  A: 

I've learned a lot from Beginning Linux Programming by Matthew and Stones, though it's more C than C++.

bbg
+3  A: 

Programming in C++ under Linux isn't all that different at the core. Linux compilers are generally more standard's conforming than MSVC; however, that is changing as MSVC is becoming a better compiler. The difference is more from the environment and available libraries. Visual Studio isn't available (obviously) but some other environments like Visual SlickEdit and Eclipse are available on both.

The build system is widely varied and will probably be dictated by your preference between Gnome, KDE, or the ever-present command line. Personally, I find the latter to be the cleanest and most consistent. If you end up at the command line, then learn GNU Make and pick up a copy of GNU Autoconf, Automake, and Libtool. This will introduce the GNU command line development stack pretty nicely.

Debugging is a lot different being that VS provides a nice GUI debugging environment. Most Linux environments simply wrap a command line debugger (usually gdb) with a GUI. The result is less than satisfactory if you expect a nicely integrated debugger. I would recommend getting comfortable with gdb. There are some decent tutorials for gdb online. Just google for a bunch of them. Once you get a little comfortable, read the online manual for the really neat stuff.

The other choice is to use whatever development environment is packaged with your windowing system or to use something like Eclipse and some C++ plug-in

As for books on the subject, Advanced Programming in the UNIX Environment is a must-read. UNIX Systems Programming is also a good read since it gives you a solid grounding in shells, processes, and what not. I would recommend both the POSIX Programmer's Guide and POSIX.4 Programmer's Guide since they give you a lot of the systems programming stuff.

With all of that said, enjoy your foray into an operating system that really cater to programmers ;)

D.Shawley
Thank you so much for your helpful answer
O. Askari