microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.97k stars 1.65k forks source link

Boost 1.70 issues #1141

Open Naville opened 5 years ago

Naville commented 5 years ago

Just a follow-up on #1054 This is seems to be an issue on boost side (interface changes it seems), however, it doesn't look like they plan to revert/fix it anytime soon.

In the comment section they prompted a few potential solutions: https://github.com/boostorg/asio/commit/59066d80b26e

Can we merge them into cpprestsdk?

[23/159] Building CXX object Release/tests/functional/webso...kettest_utilities.dir/utilities/test_websocket_server.cpp.
FAILED: Release/tests/functional/websockets/CMakeFiles/websockettest_utilities.dir/utilities/test_websocket_server.cpp.o 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DCPPREST_FORCE_HTTP_CLIENT_ASIO -DCPPREST_FORCE_HTTP_LISTENER_ASIO -DWEBSOCKETTESTUTILITY_EXPORTS -DWEBSOCKET_UTILITY_API="__attribute__ ((visibility (\"default\")))" -Dwebsockettest_utilities_EXPORTS -I../Release/tests/common/UnitTestpp -I../Release/tests/common/utilities/include -I../Release/tests/functional/websockets/utilities -I../Release/include -I../Release/tests/common/UnitTestpp/. -I../Release/libs/websocketpp -isystem /usr/local/Cellar/openssl/1.0.2r/include -stdlib=libc++ -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration -std=c++11 -fno-strict-aliasing -O3 -DNDEBUG -fPIC -MD -MT Release/tests/functional/websockets/CMakeFiles/websockettest_utilities.dir/utilities/test_websocket_server.cpp.o -MF Release/tests/functional/websockets/CMakeFiles/websockettest_utilities.dir/utilities/test_websocket_server.cpp.o.d -o Release/tests/functional/websockets/CMakeFiles/websockettest_utilities.dir/utilities/test_websocket_server.cpp.o -c ../Release/tests/functional/websockets/utilities/test_websocket_server.cpp
In file included from ../Release/tests/functional/websockets/utilities/test_websocket_server.cpp:35:
In file included from ../Release/libs/websocketpp/websocketpp/config/asio_no_tls.hpp:32:
In file included from ../Release/libs/websocketpp/websocketpp/transport/asio/endpoint.hpp:32:
In file included from ../Release/libs/websocketpp/websocketpp/transport/asio/connection.hpp:31:
In file included from ../Release/libs/websocketpp/websocketpp/transport/asio/base.hpp:31:
In file included from ../Release/libs/websocketpp/websocketpp/common/asio.hpp:61:
In file included from /usr/local/include/boost/asio/steady_timer.hpp:22:
In file included from /usr/local/include/boost/asio/basic_waitable_timer.hpp:27:
In file included from /usr/local/include/boost/asio/executor.hpp:338:
/usr/local/include/boost/asio/impl/executor.hpp:179:22: error: no member named 'context' in 'std::__1::reference_wrapper<boost::asio::io_context>'
    return executor_.context();
           ~~~~~~~~~ ^
/usr/local/include/boost/asio/impl/executor.hpp:142:3: note: in instantiation of member function 'boost::asio::executor::impl<std::__1::reference_wrapper<boost::asio::io_context>, std::__1::allocator<void> >::context' requested here
  impl(const Executor& e, const Allocator& a) BOOST_ASIO_NOEXCEPT
  ^
/usr/local/include/boost/asio/impl/executor.hpp:137:30: note: in instantiation of member function 'boost::asio::executor::impl<std::__1::reference_wrapper<boost::asio::io_context>, std::__1::allocator<void> >::impl' requested here
    impl* p = new (mem.ptr_) impl(e, a);
                             ^
/usr/local/include/boost/asio/impl/executor.hpp:333:50: note: in instantiation of member function 'boost::asio::executor::impl<std::__1::reference_wrapper<boost::asio::io_context>, std::__1::allocator<void> >::create' requested here
  : impl_(impl<Executor, std::allocator<void> >::create(e))
                                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2103:18: note: in instantiation of function template specialization 'boost::asio::executor::executor<std::__1::reference_wrapper<boost::asio::io_context> >' requested here
      : __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__config:447:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2205:9: note: in instantiation of function template specialization 'std::__1::__compressed_pair_elem<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, 1, false>::__compressed_pair_elem<std::__1::reference_wrapper<boost::asio::io_context> &&, 0>' requested here
        _Base2(__pc, _VSTD::move(__second_args),
        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3618:16: note: in instantiation of function template specialization 'std::__1::__compressed_pair<std::__1::allocator<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >, boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::__compressed_pair<std::__1::allocator<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> > &, std::__1::reference_wrapper<boost::asio::io_context> &&>' requested here
            :  __data_(piecewise_construct, _VSTD::forward_as_tuple(__a),
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization 'std::__1::__shared_ptr_emplace<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, std::__1::allocator<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> > >::__shared_ptr_emplace<std::__1::reference_wrapper<boost::asio::io_context> >' requested here
    ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization 'std::__1::shared_ptr<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::make_shared<std::__1::reference_wrapper<boost::asio::io_context> >' requested here
    return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
                            ^
../Release/libs/websocketpp/websocketpp/transport/asio/security/none.hpp:171:25: note: in instantiation of function template specialization 'std::__1::make_shared<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, std::__1::reference_wrapper<boost::asio::io_context> >' requested here
        m_socket = lib::make_shared<lib::asio::ip::tcp::socket>(
                        ^
In file included from ../Release/tests/functional/websockets/utilities/test_websocket_server.cpp:35:
In file included from ../Release/libs/websocketpp/websocketpp/config/asio_no_tls.hpp:32:
In file included from ../Release/libs/websocketpp/websocketpp/transport/asio/endpoint.hpp:32:
In file included from ../Release/libs/websocketpp/websocketpp/transport/asio/connection.hpp:31:
In file included from ../Release/libs/websocketpp/websocketpp/transport/asio/base.hpp:31:
In file included from ../Release/libs/websocketpp/websocketpp/common/asio.hpp:61:
In file included from /usr/local/include/boost/asio/steady_timer.hpp:22:
In file included from /usr/local/include/boost/asio/basic_waitable_timer.hpp:27:
In file included from /usr/local/include/boost/asio/executor.hpp:338:
/usr/local/include/boost/asio/impl/executor.hpp:169:15: error: no member named 'on_work_started' in 'std::__1::reference_wrapper<boost::asio::io_context>'
    executor_.on_work_started();
    ~~~~~~~~~ ^
/usr/local/include/boost/asio/impl/executor.hpp:142:3: note: in instantiation of member function 'boost::asio::executor::impl<std::__1::reference_wrapper<boost::asio::io_context>, std::__1::allocator<void> >::on_work_started' requested here
  impl(const Executor& e, const Allocator& a) BOOST_ASIO_NOEXCEPT
  ^
/usr/local/include/boost/asio/impl/executor.hpp:137:30: note: in instantiation of member function 'boost::asio::executor::impl<std::__1::reference_wrapper<boost::asio::io_context>, std::__1::allocator<void> >::impl' requested here
    impl* p = new (mem.ptr_) impl(e, a);
                             ^
/usr/local/include/boost/asio/impl/executor.hpp:333:50: note: in instantiation of member function 'boost::asio::executor::impl<std::__1::reference_wrapper<boost::asio::io_context>, std::__1::allocator<void> >::create' requested here
  : impl_(impl<Executor, std::allocator<void> >::create(e))
                                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2103:18: note: in instantiation of function template specialization 'boost::asio::executor::executor<std::__1::reference_wrapper<boost::asio::io_context> >' requested here
      : __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__config:447:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2205:9: note: in instantiation of function template specialization 'std::__1::__compressed_pair_elem<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, 1, false>::__compressed_pair_elem<std::__1::reference_wrapper<boost::asio::io_context> &&, 0>' requested here
        _Base2(__pc, _VSTD::move(__second_args),
        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3618:16: note: in instantiation of function template specialization 'std::__1::__compressed_pair<std::__1::allocator<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >, boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >::__compressed_pair<std::__1::allocator<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> > &, std::__1::reference_wrapper<boost::asio::io_context> &&>' requested here
            :  __data_(piecewise_construct, _VSTD::forward_as_tuple(__a),
               ^
scpeters commented 5 years ago

I believe these failures are coming from websocketpp, which is included as a git submodule in the following folder:

There is a potential fix in https://github.com/zaphoyd/websocketpp/pull/814

BattyBlogger commented 5 years ago

Was this issue ever fixed? I just installed everything according to the instructions on OSX and it does not build because of these issues.

Naville commented 5 years ago

@BattyBlogger afaik, nope. You have to install Boost1.69 and older from source instead of 70

niclar commented 4 years ago

the develop branch of websocketpp works with boost 1.71

AlexanderPaniutin commented 4 years ago

Fails for 1.72


In file included from /Users/me/github/socket.io-client-cpp/src/internal/sio_client_impl.h:29:
In file included from /Users/me/github/socket.io-client-cpp/lib/websocketpp/websocketpp/config/asio_no_tls_client.hpp:32:
In file included from /Users/me/github/socket.io-client-cpp/lib/websocketpp/websocketpp/transport/asio/endpoint.hpp:32:
In file included from /Users/me/github/socket.io-client-cpp/lib/websocketpp/websocketpp/transport/asio/connection.hpp:46:
In file included from /Users/me/boost_1_72_0/boost/asio.hpp:24:
In file included from /Users/me/boost_1_72_0/boost/asio/basic_datagram_socket.hpp:20:
In file included from /Users/me/boost_1_72_0/boost/asio/basic_socket.hpp:27:
In file included from /Users/me/boost_1_72_0/boost/asio/executor.hpp:338:
/Users/apaniutin/boost_1_72_0/boost/asio/impl/executor.hpp:194:15: error: no member named 'defer' in 'std::__1::reference_wrapper<boost::asio::io_context>'
    executor_.defer(BOOST_ASIO_MOVE_CAST(function)(f), allocator_);
    ~~~~~~~~~ ^```