How to share cross-platform program using Boost libraries

Hi,

I've written a very small, supposedly portable, http server that runs as a daemon using Boost.Asio, developed in Xcode on mac. I've used the IDE build options to include header-only libraries as well as a couple .dylibs. I now wish to test it on other systems.

My question is: what do I need to do in order to distribute and run this program on multiple operating systems(say windows 64 and linux 32)?

Here's an extract from the getting started doc:

1
2
$ c++ -I path/to/boost_1_41_0 example.cpp -o example \
   ~/boost/stage/lib/libboost_regex-gcc34-mt-d-1_36.a


Do I need to go through the boost installation in each instance?

Or can I simply include the corresponding libraries and link to them when I compile?

I'm a little lost so any help is appreciated


Well first off, you need to decide how you want to link to Boost. You can either statically link (ship Boost with your executable), or dynamically link (use target system's Boost).

I personally like to just dynamically link everything. That's the *nix way of doing things. It does have the downside of requiring your users to have Boost installed and set up correctly, though for an HTTP server I think they can manage doing that. Though this is really the only disadvantage, and there is a list of advantages to dynamic linking.
So if you couldn't tell, I highly recommend going with dynamic linking.

The next step is just to compile your application targetting whatever operating systems you want. Depending on your code, this could either be very simple or pretty tricky. If you didn't use any platform specific code it should be fairly straightforward, though.
Topic archived. No new replies allowed.