You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building off commit 96e7d20 of cpprestsdk and boost.asio commit 95f7e93, CppRestSDK does not compile, due to the following error
from /cpprestsdk/Release/src/websockets/client/ws_client_wspp.cpp:14:
/boost/boost/asio/impl/executor.hpp: In instantiation of ‘boost::asio::execution_context& boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::context() [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/learn_cpprestsdk/cpprestsdk/Release/src/websockets/client/ws_client_wspp.cpp:844:1: required from here
/boost/boost/asio/impl/executor.hpp:179:22: error: ‘class std::reference_wrapper<boost::asio::io_context>’ has no member named ‘context’
return executor_.context();
~~~~~~~~~~^~~~~~~
/boost/boost/asio/impl/executor.hpp: In instantiation of ‘void boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::on_work_started() [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/cpprestsdk/Release/src/websockets/client/ws_client_wspp.cpp:844:1: required from here
/boost/boost/asio/impl/executor.hpp:169:15: error: ‘class std::reference_wrapper<boost::asio::io_context>’ has no member named ‘on_work_started’
executor_.on_work_started();
~~~~~~~~~~^~~~~~~~~~~~~~~
git bisect reveals that the commit in boost.asio which breaks this library is:
git bisect good
59066d80b26e1d5b83b60d127ee17948d9ae9702 is the first bad commit
commit 59066d80b26e1d5b83b60d127ee17948d9ae9702
Author: Christopher Kohlhoff <[email protected]>
Date: Sun Feb 17 19:29:45 2019 -1000
Add custom I/O executor support to I/O objects.
All I/O objects now have an additional Executor template parameter. This
template parameter defaults to the asio::executor type (the polymorphic
executor wrapper) but can be used to specify a user-defined executor
type.
I/O objects' constructors and functions that previously took an
asio::io_context& now accept either an Executor or a reference to a
concrete ExecutionContext (such as asio::io_context or
asio::thread_pool).
One potential point of breakage in existing user code is when reusing an
I/O object's io_context for constructing another I/O object, as in:
asio::steady_timer my_timer(my_socket.get_executor().context());
To fix this, either construct the second I/O object using the first I/O
object's executor:
asio::steady_timer my_timer(my_socket.get_executor());
or otherwise explicitly pass the io_context:
asio::steady_timer my_timer(my_io_context);
Forgive me for not knowing if this should be submitted against boost.asio or this repo.
Root cause is the API change in Boost.Asio, which affects websocketpp (and a gazillion other people). There has been a patch for websocketpp for six months (zaphoyd/websocketpp#814) but although it's been merged to 'develop' branch it hasn't made it into 'master' or a release unfortunately.
Building off commit 96e7d20 of cpprestsdk and boost.asio commit 95f7e93, CppRestSDK does not compile, due to the following error
git bisect
reveals that the commit in boost.asio which breaks this library is:Forgive me for not knowing if this should be submitted against boost.asio or this repo.
Ubuntu 16.04,
The text was updated successfully, but these errors were encountered: