Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility issues between Boost1.76 and websocketpp0.8.2 #1080

Closed
zengxinch opened this issue Dec 29, 2022 · 5 comments
Closed

Compatibility issues between Boost1.76 and websocketpp0.8.2 #1080

zengxinch opened this issue Dec 29, 2022 · 5 comments

Comments

@zengxinch
Copy link

There is no issue when use boost1.64 and websocketpp0.8.2. However, if change to boost1.76, It seems that boost::basic_stream_socket abolish non-const boost::asio::io_context constructor. The error log as below.

@zengxinch
Copy link
Author

warning C4996: 'std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\codecvt(34): note: see declaration of 'std::codecvt_utf8'
1>: warning C4996: 'std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>,wchar_t,std::allocator<wchar_t>,std::allocator>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\xlocbuf(302): note: see declaration of 'std::wstring_convert'
1>: warning C4996: 'std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>,wchar_t,std::allocator<wchar_t>,std::allocator>::wstring_convert': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>  - Processing
1>C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\xutility(151): error C4239: nonstandard extension used: 'argument': conversion from '_Ty' to 'ExecutionContext &'
1>                    with
1>                    [
1>                        _Ty=std::reference_wrapperboost::asio::io_service
1>                    ]
1>                    and
1>                    [
1>                        ExecutionContext=std::reference_wrapperboost::asio::io_service
1>                    ]
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\xutility(151): note: A non-const reference may only be bound to an lvalue
1>: warning C4996: 'std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\codecvt(34): note: see declaration of 'std::codecvt_utf8'
1>: warning C4996: 'std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>,wchar_t,std::allocator<wchar_t>,std::allocator>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\xlocbuf(302): note: see declaration of 'std::wstring_convert'
1>: warning C4996: 'std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>,wchar_t,std::allocator<wchar_t>,std::allocator>::wstring_convert': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>: warning C4996: 'std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>,wchar_t,std::allocator<wchar_t>,std::allocator>::to_bytes': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\xutility(151): error C4239: nonstandard extension used: 'argument': conversion from '_Ty' to 'ExecutionContext &'
1>                    with
1>                    [
1>                        _Ty=std::reference_wrapperboost::asio::io_service
1>                    ]
1>                    and
1>                    [
1>                        ExecutionContext=std::reference_wrapperboost::asio::io_service
1>                    ]

1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\xutility(151): note: A non-const reference may only be bound to an lvalue
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\memory(2021): note: see reference to function template instantiation 'void std::_Construct_in_place<_Ty,std::reference_wrapperboost::asio::io_service>(_Ty &,std::reference_wrapperboost::asio::io_service &&) noexcept(false)' being compiled
1>                    with
1>                    [
1>                        _Ty=boost::asio::ip::tcp::socket
1>                    ]
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\memory(2747): note: see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<std::reference_wrapperboost::asio::io_service>(std::reference_wrapperboost::asio::io_service &&)' being compiled
1>                    with
1>                    [
1>                        _Ty=boost::asio::ip::tcp::socket
1>                    ]
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\memory(2748): note: see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<std::reference_wrapperboost::asio::io_service>(std::reference_wrapperboost::asio::io_service &&)' being compiled
1>                    with
1>                    [
1>                        _Ty=boost::asio::ip::tcp::socket
1>                    ]
1>            C:websocketpp\websocketpp/transport/asio/security/none.hpp(172): note: see reference to function template instantiation 'std::shared_ptrwebsocketpp::transport::asio::basic_socket::connection::socket_type std::make_shared<boost::asio::ip::tcp::socket,std::reference_wrapperboost::asio::io_service>(std::reference_wrapperboost::asio::io_service &&)' being compiled
1>\boost_1_76_0\boost/asio/detail/io_object_impl.hpp(59): error C2039: 'get_executor': is not a member of 'std::reference_wrapperboost::asio::io_service'
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\type_traits(1914): note: see declaration of 'std::reference_wrapperboost::asio::io_service'
1>            C:boost_1_76_0\boost/asio/basic_socket.hpp(133): note: see reference to function template instantiation 'boost::asio::detail::io_object_impl<boost::asio::detail::win_iocp_socket_service,Executor>::io_object_impl(int,int,ExecutionContext &)' being compiled
1>                    with
1>                    [
1>                        Protocol=boost::asio::ip::tcp,
1>: warning C4996: 'std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>,wchar_t,std::allocator<wchar_t>,std::allocator>::to_bytes': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>     
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\memory(2021): note: see reference to function template instantiation 'void std::_Construct_in_place<_Ty,std::reference_wrapperboost::asio::io_service>(_Ty &,std::reference_wrapperboost::asio::io_service &&) noexcept(false)' being compiled
1>                    with
1>                    [
1>                        _Ty=boost::asio::ip::tcp::socket
1>                    ]
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\memory(2747): note: see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<std::reference_wrapperboost::asio::io_service>(std::reference_wrapperboost::asio::io_service &&)' being compiled
1>                    with
1>                    [
1>                        _Ty=boost::asio::ip::tcp::socket
1>                    ]
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\memory(2748): note: see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<std::reference_wrapperboost::asio::io_service>(std::reference_wrapperboost::asio::io_service &&)' being compiled
1>                    with
1>                    [
1>                        _Ty=boost::asio::ip::tcp::socket
1>                    ]
1>           \websocketpp\websocketpp/transport/asio/security/none.hpp(172): note: see reference to function template instantiation 'std::shared_ptrwebsocketpp::transport::asio::basic_socket::connection::socket_type std::make_shared<boost::asio::ip::tcp::socket,std::reference_wrapperboost::asio::io_service>(std::reference_wrapperboost::asio::io_service &&)' being compiled
1>C:\boost_1_76_0\boost/asio/detail/io_object_impl.hpp(59): error C2039: 'get_executor': is not a member of 'std::reference_wrapperboost::asio::io_service'
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\type_traits(1914): note: see declaration of 'std::reference_wrapperboost::asio::io_service'
1>            boost_1_76_0\boost/asio/ip/basic_resolver.hpp(127): note: see reference to function template instantiation 'boost::asio::detail::io_object_impl<boost::asio::detail::resolver_service,Executor>::io_object_impl(int,int,ExecutionContext &)' being compiled
1>                    with
1>                    [
1>                        InternetProtocol=boost::asio::ip::tcp,
1>                        Executor=boost::asio::any_io_executor,
1>                        ExecutionContext=std::reference_wrapperboost::asio::io_service
1>                    ]
1>            boost_1_76_0\boost/asio/ip/basic_resolver.hpp(126): note: see reference to function template instantiation 'boost::asio::detail::io_object_impl<boost::asio::detail::resolver_service,Executor>::io_object_impl(int,int,ExecutionContext &)' being compiled
1>                    with
1>                    [
1>                        InternetProtocol=boost::asio::ip::tcp,
1>                        Executor=boost::asio::any_io_executor,
1>                        ExecutionContext=std::reference_wrapperboost::asio::io_service
1>                    ]
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\xutility(151): note: see reference to function template instantiation 'boost::asio::ip::basic_resolverboost::asio::ip::tcp,boost::asio::any_io_executor::basic_resolver<_Ty>(ExecutionContext &,int)' being compiled
1>                    with
1>                    [
1>                        _Ty=std::reference_wrapperboost::asio::io_service,
1>                        ExecutionContext=std::reference_wrapperboost::asio::io_service
1>                    ]
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\xutility(158): note: see reference to function template instantiation 'boost::asio::ip::basic_resolverboost::asio::ip::tcp,boost::asio::any_io_executor::basic_resolver<_Ty>(ExecutionContext &,int)' being compiled
1>                    with
1>                    [
1>                        _Ty=std::reference_wrapperboost::asio::io_service,
1>                        ExecutionContext=std::reference_wrapperboost::asio::io_service
1>                    ]
1>            C:\apps\MVS16117\VC\Tools\MSVC\14.29.30133\include\memory(2021): note: see reference to function template instantiation 'void std::_Construct_in_place<_Ty,std::reference_wrapperboost::asio::io_service>(_Ty &,std::reference_wrapperboost::asio::io_service &&) noexcept(false)' being compiled
1>                    with
1>                    [
1>                        _Ty=boost::asio::ip::tcp::resolver
1>                    ]

@zengxinch
Copy link
Author

Sorry, I check that I used 0.8.1 instead of 0.8.2

@zzsqwq
Copy link

zzsqwq commented Jan 5, 2023

Hello, sorry to bother you, can Boost 1.76 + Websocketpp 0.8.2 work properly? When I tested it, I found that Websocketpp does not seem to work properly in Boost 1.74+, and it seems that there are some asio-related interface changes.

@zengxinch
Copy link
Author

For me, Boost 1.76 + Websocketpp 0.8.2 work correctly. You may have a try of 1.76 or websocketpp 0.8.1

@zzsqwq
Copy link

zzsqwq commented Jan 5, 2023

For me, Boost 1.76 + Websocketpp 0.8.2 work correctly. You may have a try of 1.76 or websocketpp 0.8.1

I will try it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants