Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Getting started with strand
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2013-07-02 12:53:43


On Tue, Jul 2, 2013 at 10:53 AM, Michael Powell <mwpowellhtx_at_[hidden]> wrote:
> Hello,
>
> I want to get started using asio strand if at all possible.
>
> Getting started, however, I am struggling with a couple of
> errors/issues. For starters:

I am a one or two compiler switches away from making this work I
believe. The docs are sparse where that's concerned, of course. For
what it's worth, maybe this will help someone else too.

In the steady_timer.hpp, I have BOOST_ASIO_HAS_BOOST_CHRONO defined
(for starters), but the steady_timer typedef does not go. Oddly, I can
use basic_waitable_timer<boost::chrono::steady_clock> without typedef,
and work with that it seems.

//...
#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
typedef basic_waitable_timer<boost::chrono::steady_clock> steady_timer;
#endif
//...

Also, studying the boiler plate (it's boiler plate, I know, and a
great start, don't get me wrong...), I replace some of the std usages,
for things like std::move, favoring boost::shared_ptr instead because
the move issues weren't working,

Haven't quite gotten through building and/or linking. I expect will
need to include libs: boost_chrono, boost_context, boost_coroutine,
boost_regex, boost_serialization, boost_timer, for this to work?

> * Cannot find std::enable_shared_from_this, std::move: they do not
> exist in our environment.
> * From there a ton of what look like steady-timer-related errors.
>
> Many of the errors are linker errors I think. Symbols cannot be
> resolved, such like this. I am pretty sure I am linking with the
> correct Boost libraries (statically, multi-threaded). Possibly need to
> rebuild Boost with different compiler settings?
>
> Also, possibly we do not have the correct compile-time switches
> enabled. Possibly also not linking with the correct libraries.
>
> We are cross-compiling into ArchLinux for ARM using Sourcery
> CodeBench, basically a GCC 4.7.2 based environment.
>
> That or are we stuck with the old-style approach to scheduling asio
> io_service callbacks?
>
> Would much prefer strands if we can somehow manage it.
>
> Thank you...
>
> Regards,
>
> Michael Powell


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