views:

46

answers:

2

I want to start writing platform independent and open source code (mostly C++). What do I have to consider when doing so? Stop using IDEs and use makefiles from now on? What do all the "professional" open source coders do (like the guys behind GNU) and what tools do they use? I'm especially interested into developing shared libraries. How do I make these cross platform (so it works as ".so" on Linux and as ".dll" on Windows)?

I'm working on Windows so I'm not that much into all the Linux tools and terminology. Are there good tools to get the same result on Windows as on Linux?

+1  A: 

You haven't really said what it is that you want to code. So there are almost infinitely many ways in which you could go -- and countless examples you could start with.

One starting point I like (given C++) is Qt:

  • a very rich and complete framework
  • very well documented
  • complete tool chain you can use (incl portable IDE) or ignore (qmake builds Makefiles anyway)
  • very actively supported
  • and comes with gazillion examples you could study.
Dirk Eddelbuettel
No, I don't seek tips on how to code, I'm looking for Ins and Outs of coding. What is good practice in general? All the stuff you don't learn from the coding books.
Lukas Schmelzeisen
May I point out that "almost infinite" is infinite as well? :)
JoshJordan
Lukas: There are lots of famous open source projects implemented in Qt (to stay with that example). *Study the source code*, hang out on the lists and ask specific questions. As for one of your concrete questions, shared libraries are handled by the qmake build framework and your Qt configuration. You can build either shared or static on either Windows or Linux. Been there, done that.
Dirk Eddelbuettel
Josh: What about 'almost infinite minus four'? 'Minus six'? Seriously: thanks for the proofreading :)
Dirk Eddelbuettel
A: 

I'm not very familiar with windows deployment. What I've seen in various project (like pygtk) is that the deployment in windows/linux is splitted.

I don't think that using automake to develop windows application is a good choice (though is the standard on linux).

Suggestion that comes in mind are:

  1. Ides can limit you to a restrict set of tools that can be platform-dependent, use it carefully
  2. Consider using SCons as a build tool it seems more modern than make and it's portable since it's written in python
  3. Take the deploy on a separate stage, the 2 system are totally different, in Linux most packaging work is done by "packagers" of various distribution,the standard de-facto is autotools (./compile, make, make install), however SCons actually can be used as well.

P.S. Learning autotools can be really challenging.

pygabriel