cpp-bredis
cpp-bredis copied to clipboard
Mac build failure
After I build with Cmake and invoke the make command, these errors occur. What should I do to solve this?
/Users/Stephen/documents/cpp-bredis/include/bredis/impl/connection.ipp:61:40: error: no matching constructor for initialization of 'asio::async_result<real_handler_t>' (aka 'async_result<coro_handler<boost::asio::executor_binder<void ()(), boost::asio::executor>, bredis::positive_parse_result_t<boost::asio::buffers_iterator<boost::asio::const_buffers_1, char>, bredis::parsing_policy::keep_result> > >') asio::async_result<real_handler_t> async_result(real_handler); ^ ~~~~~~~~~~~~ /Users/Stephen/documents/cpp-bredis/t/21-coroutine.cpp:53:35: note: in instantiation of function template specialization 'bredis::Connection<boost::asio::basic_stream_socketboost::asio::ip::tcp >::async_read<boost::asio::basic_streambuf<std::__1::allocator
>, boost::asio::basic_yield_context<boost::asio::executor_binder<void ( )(), boost::asio::executor> > >' requested here auto parse_result = c.async_read(rx_buff, yield[error_code], 1); ^ /usr/local/include/boost/asio/async_result.hpp:50:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'real_handler_t' (aka 'coro_handler<boost::asio::executor_binder<void ()(), boost::asio::executor>, bredis::positive_parse_result_t<boost::asio::buffers_iterator<boost::asio::const_buffers_1, char>, bredis::parsing_policy::keep_result> >') to 'const boost::asio::async_result<boost::asio::detail::coro_handler<boost::asio::executor_binder<void ()(), boost::asio::executor>, bredis::positive_parse_result_t<boost::asio::buffers_iterator<boost::asio::const_buffers_1, char>, bredis::parsing_policy::keep_result> >, void>' for 1st argument class async_result ^ /usr/local/include/boost/asio/impl/spawn.hpp:316:12: note: candidate constructor not viable: no known conversion from 'real_handler_t' (aka 'coro_handler<boost::asio::executor_binder<void ()(), boost::asio::executor>, bredis::positive_parse_result_t<boost::asio::buffers_iterator<boost::asio::const_buffers_1, char>, bredis::parsing_policy::keep_result> >') to 'typename detail::coro_async_result<executor_binder<void ()(), executor>, void>::completion_handler_type &' (aka 'coro_handler<boost::asio::executor_binder<void (*)(), boost::asio::executor>, void> &') for 1st argument explicit async_result( ^ 3 warnings and 2 errors generated. make[2]: *** [CMakeFiles/t-21-coroutine.dir/t/21-coroutine.cpp.o] Error 1 make[1]: *** [CMakeFiles/t-21-coroutine.dir/all] Error 2 make: *** [all] Error 2
Hello,
I think coroutines support is broken in the latest boost::asio; it does not build on linux too.
Try to use Boost v1.64
.
I'm trying to build with Boost Beast, which isn't included in version 1.64. I think I will try to edit the cpp-bredis code by removing coroutines. Is that practical?
Sure, go on, PRs are welcome.
BTW, the PR to Boost::ASIO might be helpful for you
https://github.com/boostorg/asio/pull/55
Another approach - do not use Coroutines
. Current bredis
code does not uses coroutines directly.
Another option is to use an updated coroutine completion token such as https://github.com/blinktrade/iofiber or code one yourself.