aldebaran / libqi

NAOqi core framework
http://doc.aldebaran.com/libqi/
BSD 3-Clause "New" or "Revised" License
66 stars 53 forks source link

Compilation fails with boost-1.58 #14

Closed severin-lemaignan closed 3 years ago

severin-lemaignan commented 8 years ago

Compilation fails with the following error:

/libqi/src/eventloop.cpp:355:16: error: call to 'bind' is ambiguous
      _io.post(boost::bind<void>(&EventLoopAsio::invoke_maybe, this, cb, id, p, erc));
               ^~~~~~~~~~~~~~~~~
/usr/include/boost/bind/bind_mf_cc.hpp:201:5: note: candidate function [with R = void, T = qi::EventLoopAsio, B1 = boost::function<void ()>, B2 = unsigned int, B3 = qi::Promise<void>, B4 =
      const boost::system::error_code &, A1 = qi::EventLoopAsio *, A2 = boost::function<void ()>, A3 = unsigned int, A4 = qi::Promise<void>, A5 = boost::system::error_code]
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
/usr/include/boost/bind/bind.hpp:1579:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
/usr/include/boost/bind/bind_mf_cc.hpp:223:5: note: candidate function [with Rt2 = void, R = void, T = qi::EventLoopAsio, B1 = boost::function<void ()>, B2 = unsigned int, B3 =
      qi::Promise<void>, B4 = const boost::system::error_code &, A1 = qi::EventLoopAsio *, A2 = boost::function<void ()>, A3 = unsigned int, A4 = qi::Promise<void>, A5 =
      boost::system::error_code]
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
/usr/include/boost/bind/bind.hpp:1579:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
/usr/include/boost/bind/bind.hpp:1626:5: note: candidate function [with R = void, F = void (qi::EventLoopAsio::*)(boost::function<void ()>, unsigned int, qi::Promise<void>, const
      boost::system::error_code &), A1 = qi::EventLoopAsio *, A2 = boost::function<void ()>, A3 = unsigned int, A4 = qi::Promise<void>, A5 = boost::system::error_code]
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
/usr/include/boost/bind/bind.hpp:1579:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^

Tried on ubuntu 16.04 with both gcc-5.3.1 and clang-3.8.

severin-lemaignan commented 8 years ago

The fix consists in removing <void> from expressions like boost::bind<void>(...).

vbarbaresi commented 8 years ago

Indeed, master branch is compatible only with Boost 1.59 release-2.4 branch is compatible with Boost 1.55, but there is nothing in between, we made a 1.55-1.59 jump README file is lacking this information (issue #13)

PS: Hi Séverin!

severin-lemaignan commented 8 years ago

Hum... this is a pity: ubuntu 16.04 comes with boost 1.58... I was about to submit a PR so that it also compiles on boost 1.58. Would you consider merging it if it does not impair boost 1.59 compilation?

severin-lemaignan commented 8 years ago

PS: hi Vincent ;-)

vbarbaresi commented 8 years ago

Of course, submit a PR, we'll check it with our code base and integrate it.

That being said, we provide public toolchains if you need boost-1.59: https://github.com/aldebaran/toolchains The behavior with 1.58 hasn't been tested, so there could be bugs

severin-lemaignan commented 8 years ago

Here you are :-)

alkino commented 8 years ago

Behavior with boost-1.58 has been unofficially tested. And this version got a lot of bugs. So we accept to not support it. We unofficially go from 1.57 to 1.59. Officially it's 1.55 -> 1.59. But we are of course always open to more compatibility.

warp1337 commented 6 years ago

Like some other issues with libqi stuff I also ran into this. I would appreciate if the PR was merged.

Klaim commented 6 years ago

The current versions (in team/platform/dev) works with boost 1.59 and 1.64. I'll update master soon but it should already have been compiling with 1.59 as mentionned by @vbarbaresi .

Do you still have issues?

warp1337 commented 6 years ago

If boost 1.59 is downward compatible with 1.58, then no :)

Klaim commented 6 years ago

It's not, but issues we had when upgrading to 1.59 should also help for 1.58. We also rewrote Eventloop internals so if you could check if you still have problems with team/platform/dev branch that would help us identify what is now missing for 1.58.

warp1337 commented 6 years ago

Okay, thx I will give it a try.