Boost logo

Boost Users :

Subject: Re: [Boost-users] quick question about macro
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2017-02-24 01:51:02


On 23/02/2017 19:29, Peter Gusev via Boost-users wrote:
> I'm using boost library occasionally and have this simpleton question to
> ask.
> i need to debug *boost::asio::io_service* by
> enabling *BOOST_ASIO_ENABLE_HANDLER_TRACKING* macro.
>
> so, do I have to rebuild the library like
>
> /* ./b2 cxxflags="-DBOOST_ASIO_ENABLE_HANDLER_TRACKING"...*/
>
> or adding
>
> /* #define BOOST_ASIO_ENABLE_HANDLER_TRACKING*/
>
> to my source file is enough? (this doesn't work for me, so i suspect I
> should go with the first option)

Asio is a header-based library, so doing anything with b2 isn't going to
accomplish anything.

You need to add the #define ahead of any inclusion of the Asio headers
in any source file that uses them. The simplest option is generally to
put it in your project file (or whatever you're using to build your
application).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net