tags:

views:

1744

answers:

11

I am working on C++ and COM/ATL in Windows from last few years. Now I want to shift to Linux Programming. I know basic architecture of Linux. I did some of the projects which are using ncurses, sockets and audio libraries(Terminal Applications). On which tool I should be familiar to start with projects. In windows I have started with Win32 Programming then moved to COM and ATL. Win32 Programming gave me the insights of Windows.

Can you give me the steps to start with Linux Programming?

+12  A: 

Depends what you're trying to do...

Are you going to be doing GUI apps? Learn Qt or GTK or wxWidgets. Are you going to be doing device driver development? Learn straight C, not just C++. A lot of the exciting software development under Linux happens in Python and Perl (and other dynamic languages to a lesser extent), so you should almost certainly learn one of those.

Dan
+12  A: 
  • gcc/g++
  • understand shell basics: probably bash (typically the default)
  • make (you don't have to be an expert, or even use it in your own work, but you should understand it)
  • a scripting language (bash, ruby, python, tcl, perl; you choose)
  • basic unix command line utilities (ls, cd, etc....)
  • an editor: vi or emacs are the most popular choices.
  • linux. your distribution in particular (ubuntu is popular; you may want to start there). know how to tweek your environment and how to fix things when they break.

The rest depends on what you want to do.

You do not need to be an expert at any of this; you will learn over time.

ejgottl
he asked how to start programming( not bash one-liners)
Quamis
+8  A: 

The pragmatic answer

I understand why you ask your question this way but Linux is not Windows, so there is really no straight answer. Actually we are talking about GNU/linux + all the free software ecosystem, so what you have to learn depends very much of what you want to do.

If you are more into system programming, you will look at the linux kernel and need to work on your C skills.

If your want to code utilities, scripting languages (especially ruby and python) will be your tools of choice, and you'll have to choose a GUI framework on top of that (GTK, QT and wxWidget show the way).

If it's more about web and network programming : python, ruby, php or java can do it.

The good news

In the Linux env, you have the choice because of lot of people use a lot of different tools. It can seems messy, and often is, but it works not so bad.

So stop thinking about what you must learn and focus on 2 questions :

  • do I want to join a project ? Then the techno will be choosen by the project you join. So choose a project using a tech YOU WANT to learn.
  • do I want to start my own project ? Then the techno will be choosen by the existing tool you will rely on. Most of the time, you will have the choice, so enjoy your new freedom and learn the tech YOU WANT.

Free, as in freedom mate, means you can choose.

e-satis
+1  A: 

I also recommend you learn the STL and Boost - the latter is especially useful when writing C++ apps in Linux as you get libraries for threading, file system, regex, etc. Plus the code can be ported back to Windows if necessary. This is how I got started in Linux - I took a Windows project and converted to use the STL/Boost and added a browser-based UI. Once it was up and running in Windows - but with no actual Windows specifics in the code - I set about learning the Linux basics (gcc, make, etc.) and got it working very quickly.

Rob
+1  A: 

Draw on your already hard earned knowledge of COM and learn something like TAO. Obviously, there is no ATL or WTL in the unix world... so you'll have to invest time to learn the STL - the good news is STL exists on windows too. Boost will help you go between platforms significantly easier, so you should learn that too.

Beyond that, it really depends on what you want to do.

ceretullis
A: 

I would recommend you to start by using Gentoo, it should be hard the first weeks, but after a while (say 2 months and less if you have basic linux understand ) you will be able to use every distribution and you will know exactly what will happen and how on your system when you press/digit something, I think that you will be re-paid for this more time (learn gentoo is a bit harder then other distros) spent on Gentoo. And this I think will be helpful when programming for linux.

luiss
A: 

When developing for Linux, I tend to stick with the basics: vim, gcc, gdb (from command line, no front ends), svn, cscope, Valgrind, make (not that I am a big fan of make, I admit). Various graphical front ends exist, and even IDEs, but I don't like any of them.

Nemanja Trifunovic
A: 

I suggest learning CMake - it's a great cross-platform build tool that is much easier to use than make/autotools.

thekidder
A: 

Could you elaborate on the sort of things you hope to do, in as far as Linux programming is concerned? This might have most of what you hope to go through, regardless.

nak
+1  A: 

Start reading the book Advanced Linux Programming which is also available as a free PDF.

Do not fear the advanced keyword. From the details of your post (ncurses, sockets) you are already "advanced".

You can also look later at the glib library (Standard component of GTK+/GNOME but also used in command line applications.)

If you absolutely have to program in C++, read the whole documenation of QT and you are good to go.

kazanaki
+2  A: 

Read The Art of UNIX Programming

This will help you understand why things are done as they are in a *unix based system.

Tanj