|
Boost : |
Subject: Re: [boost] boost namespace
From: Artyom (artyomtnk_at_[hidden])
Date: 2009-06-23 06:24:16
> I need to use two versions of boost in my
> application. One the libs I link
> against is statically linked against boost 1.34 and I'd
> like to use 1.35's
> asio library.
First of all Asio comes as stand alone library outside
of boost namespace. So, you may just use it as is or use
namespace renaming:
#ifdef USE_BOOST_ASIO
#include <boost/asio.hpp>
namespace netio = boost::asio;
using boost::system::error_code;
using boost::system::system_error;
#else
#include <asio.hpp>
namespace netio = asio;
using asio::error_code;
using asio::system_error;
#endif
And then just relate to netio::... so you would
keep an ability to upgrade to boost asio in future.
This is the way I build CppCMS http://cppcms.sourceforge.net/
conditionally using Boost 1.33.1 and Asio or boost 1.35 and above only.
> I believe I can make both versions
> co-exist if I can manage
> to rename boost 1.35's namespace to something like
> boost135.
>
Take a look on a script I had written once:
http://lists.boost.org/boost-build/2009/05/21911.php
But note! boost 1.35 and 1.34 are not compatible nither
ABI nor API.
So you **must** not mix them in same module! This may be very tricky.
So you can't use boost in interfaces between modules that use different
versions of boost.
Artyom
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk