构建 Boost Beast 示例时出现编译错误 websocket_server_sync
Compilation errors when building Boost Beast example websocket_server_sync
我正在尝试使用 Boost Beast 示例中的 websocket-server-sync 示例构建 Boost。首先,我想说的是,我正在使用 MSVS 2017 专业版 15.3.5 和 SDK 版本 10.0.14393.0 构建 Windows 10。我构建 Boost 的步骤如下:
首先我当然开始 bootstrap.cmd
然后我 运行 .\b2 variant=release variant=debug link=static threading=multi address-model=64
构建静态 Boost 库。 运行这两步就成功了。
下一步是为 运行 设置 Boost Beast 示例的 Visual Studio 解决方案。为了能够做到这一点,我需要调用 cmake 构建系统。因此,我在 \libs\beast 和 运行 中创建了构建文件夹,命令 cmake -G "Visual Studio 15 2017 Win64" ..
为 Visual Studio 创建了所需的解决方案。 cmake 过程成功。这里是日志:
-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.11.25508.2
-- The CXX compiler identification is MSVC 19.11.25508.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/winapp/MSVS2017PRO/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/winapp/MSVS2017PRO/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: optimized;C:/drive_d/programming/projects/cpp/3rdparty/external/lib/libcrypto.lib;debug;C:/drive_d/programming/projects/cpp/3rdparty/external/lib/libcryptod.lib (found version "1.1.0i")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/drive_d/programming/projects/cpp/3rdparty/boost_1_75_0/libs/beast/build
我在 Visual Studio 中启动了解决方案并尝试构建项目“websocket-server-sync”(配置:调试 | 平台:x64)并出现以下错误:
...
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): error C2668: 'boost::asio::buffer_sequence_begin': ambiguous call to overloaded function
...
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): error C3546: '...': there are no parameter packs available to expand
...
整个 Visual Studio 构建输出如下。从日志中可以看出错误发生在lib-beast和websocket-server-sync项目中(websocket-server-sync依赖于解决方案中包含的lib-beast和lib-asio项目):
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
2>------ Rebuild All started: Project: lib-asio, Configuration: Debug x64 ------
2>Building Custom Rule C:/drive_d/programming/projects/cpp/3rdparty/boost_1_75_0/libs/beast/CMakeLists.txt
2>lib_asio.cpp
2>lib-asio.vcxproj -> C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\libs\beast\build\Debug\lib-asio.lib
3>------ Rebuild All started: Project: lib-beast, Configuration: Debug x64 ------
3>Building Custom Rule C:/drive_d/programming/projects/cpp/3rdparty/boost_1_75_0/libs/beast/CMakeLists.txt
3>lib_beast.cpp
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): error C2668: 'boost::asio::buffer_sequence_begin': ambiguous call to overloaded function
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/buffer.hpp(399): note: could be 'const boost::asio::const_buffer *boost::asio::buffer_sequence_begin<add_rvalue_reference<_Ty>::type>(const ConstBuffer &,enable_if<std::is_convertible<const add_rvalue_reference<_Ty>::type*,const boost::asio::const_buffer*>::value,void>::type *) noexcept'
3> with
3> [
3> _Ty=const unknown-type &,
3> ConstBuffer=add_rvalue_reference<const unknown-type&>::type
3> ]
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/buffer.hpp(389): note: or 'const boost::asio::mutable_buffer *boost::asio::buffer_sequence_begin<add_rvalue_reference<_Ty>::type>(const MutableBuffer &,enable_if<std::is_convertible<const add_rvalue_reference<_Ty>::type*,const boost::asio::mutable_buffer*>::value,void>::type *) noexcept'
3> with
3> [
3> _Ty=const unknown-type &,
3> MutableBuffer=add_rvalue_reference<const unknown-type&>::type
3> ]
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): note: while trying to match the argument list '(add_rvalue_reference<_Ty>::type)'
3> with
3> [
3> _Ty=const unknown-type &
3> ]
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): note: see reference to alias template instantiation 'buffers_iterator_type<unknown-type>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/http/chunk_encode.hpp(251): note: see reference to class template instantiation 'boost::beast::buffers_cat_view<boost::beast::http::detail::chunk_size,boost::asio::const_buffer,boost::beast::http::chunk_crlf>::const_iterator' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/relationship.hpp(474): note: see reference to class template instantiation 'boost::asio::execution::detail::relationship_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/outstanding_work.hpp(475): note: see reference to class template instantiation 'boost::asio::execution::detail::outstanding_work_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/occupancy.hpp(123): note: see reference to class template instantiation 'boost::asio::execution::detail::occupancy_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/mapping.hpp(604): note: see reference to class template instantiation 'boost::asio::execution::detail::mapping_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/context.hpp(130): note: see reference to class template instantiation 'boost::asio::execution::detail::context_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/bulk_guarantee.hpp(687): note: see reference to class template instantiation 'boost::asio::execution::detail::bulk_guarantee_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/blocking_adaptation.hpp(663): note: see reference to class template instantiation 'boost::asio::execution::detail::blocking_adaptation_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/blocking.hpp(836): note: see reference to class template instantiation 'boost::asio::execution::detail::blocking_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): error C3546: '...': there are no parameter packs available to expand
3>Done building project "lib-beast.vcxproj" -- FAILED.
4>------ Rebuild All started: Project: websocket-server-sync, Configuration: Debug x64 ------
4>Building Custom Rule C:/drive_d/programming/projects/cpp/3rdparty/boost_1_75_0/libs/beast/example/websocket/server/sync/CMakeLists.txt
4>websocket_server_sync.cpp
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): error C2668: 'boost::asio::buffer_sequence_begin': ambiguous call to overloaded function
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/buffer.hpp(399): note: could be 'const boost::asio::const_buffer *boost::asio::buffer_sequence_begin<add_rvalue_reference<_Ty>::type>(const ConstBuffer &,enable_if<std::is_convertible<const add_rvalue_reference<_Ty>::type*,const boost::asio::const_buffer*>::value,void>::type *) noexcept'
4> with
4> [
4> _Ty=const unknown-type &,
4> ConstBuffer=add_rvalue_reference<const unknown-type&>::type
4> ]
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/buffer.hpp(389): note: or 'const boost::asio::mutable_buffer *boost::asio::buffer_sequence_begin<add_rvalue_reference<_Ty>::type>(const MutableBuffer &,enable_if<std::is_convertible<const add_rvalue_reference<_Ty>::type*,const boost::asio::mutable_buffer*>::value,void>::type *) noexcept'
4> with
4> [
4> _Ty=const unknown-type &,
4> MutableBuffer=add_rvalue_reference<const unknown-type&>::type
4> ]
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): note: while trying to match the argument list '(add_rvalue_reference<_Ty>::type)'
4> with
4> [
4> _Ty=const unknown-type &
4> ]
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): note: see reference to alias template instantiation 'buffers_iterator_type<unknown-type>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/http/chunk_encode.hpp(251): note: see reference to class template instantiation 'boost::beast::buffers_cat_view<boost::beast::http::detail::chunk_size,boost::asio::const_buffer,boost::beast::http::chunk_crlf>::const_iterator' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/relationship.hpp(474): note: see reference to class template instantiation 'boost::asio::execution::detail::relationship_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/outstanding_work.hpp(475): note: see reference to class template instantiation 'boost::asio::execution::detail::outstanding_work_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/occupancy.hpp(123): note: see reference to class template instantiation 'boost::asio::execution::detail::occupancy_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/mapping.hpp(604): note: see reference to class template instantiation 'boost::asio::execution::detail::mapping_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/context.hpp(130): note: see reference to class template instantiation 'boost::asio::execution::detail::context_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/bulk_guarantee.hpp(687): note: see reference to class template instantiation 'boost::asio::execution::detail::bulk_guarantee_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/blocking_adaptation.hpp(663): note: see reference to class template instantiation 'boost::asio::execution::detail::blocking_adaptation_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/blocking.hpp(836): note: see reference to class template instantiation 'boost::asio::execution::detail::blocking_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): error C3546: '...': there are no parameter packs available to expand
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/http/parser.hpp(56): error C2338: BodyReader type requirements not met
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/websocket/impl/handshake.hpp(48): note: see reference to class template instantiation 'boost::beast::http::parser<false,boost::beast::http::basic_string_body<char,std::char_traits<char>,std::allocator<char>>,std::allocator<char>>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/websocket/impl/handshake.hpp(56): note: see reference to class template instantiation 'boost::beast::websocket::stream<NextLayer,deflateSupported>::handshake_op<Handler>::data' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/websocket/impl/handshake.hpp(185): note: see reference to class template instantiation 'boost::beast::websocket::stream<NextLayer,deflateSupported>::handshake_op<Handler>' being compiled
4>Done building project "websocket-server-sync.vcxproj" -- FAILED.
========== Rebuild All: 2 succeeded, 2 failed, 0 skipped ==========
有人可以告诉我这里发生了什么或者我做错了什么吗?
我在 Boost Beast 项目的 Github 页面上也有 post 这个问题,我从一位维护者那里得到了一个答案,说很难编译 Boost Beast 示例项目,因为MSVS 2017 本身旧版本中的错误(请参阅 link 我的问题的答案)。结论是还是用MSVS 2019比较靠谱,在那边编译。
我也试过用 MSVS 2019 编译它并且它有效。
如果您无法更改 MSVS 版本,那么您应该联系维护人员来帮助您解决问题。对我来说,我的 MSVS 2017 版本(不是最新的 MSVS 2017 版本)在编译 Beast 时出现问题的信息就足够了。
更新:
关于使用 MSVS 2017 构建 Boost Beast,最新版本的 MSVS 2017 应该可以正常工作 (link here)。
我正在尝试使用 Boost Beast 示例中的 websocket-server-sync 示例构建 Boost。首先,我想说的是,我正在使用 MSVS 2017 专业版 15.3.5 和 SDK 版本 10.0.14393.0 构建 Windows 10。我构建 Boost 的步骤如下:
首先我当然开始 bootstrap.cmd
然后我 运行 .\b2 variant=release variant=debug link=static threading=multi address-model=64
构建静态 Boost 库。 运行这两步就成功了。
下一步是为 运行 设置 Boost Beast 示例的 Visual Studio 解决方案。为了能够做到这一点,我需要调用 cmake 构建系统。因此,我在 \libs\beast 和 运行 中创建了构建文件夹,命令 cmake -G "Visual Studio 15 2017 Win64" ..
为 Visual Studio 创建了所需的解决方案。 cmake 过程成功。这里是日志:
-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.11.25508.2
-- The CXX compiler identification is MSVC 19.11.25508.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/winapp/MSVS2017PRO/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/winapp/MSVS2017PRO/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: optimized;C:/drive_d/programming/projects/cpp/3rdparty/external/lib/libcrypto.lib;debug;C:/drive_d/programming/projects/cpp/3rdparty/external/lib/libcryptod.lib (found version "1.1.0i")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/drive_d/programming/projects/cpp/3rdparty/boost_1_75_0/libs/beast/build
我在 Visual Studio 中启动了解决方案并尝试构建项目“websocket-server-sync”(配置:调试 | 平台:x64)并出现以下错误:
...
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): error C2668: 'boost::asio::buffer_sequence_begin': ambiguous call to overloaded function
...
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): error C3546: '...': there are no parameter packs available to expand
...
整个 Visual Studio 构建输出如下。从日志中可以看出错误发生在lib-beast和websocket-server-sync项目中(websocket-server-sync依赖于解决方案中包含的lib-beast和lib-asio项目):
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
2>------ Rebuild All started: Project: lib-asio, Configuration: Debug x64 ------
2>Building Custom Rule C:/drive_d/programming/projects/cpp/3rdparty/boost_1_75_0/libs/beast/CMakeLists.txt
2>lib_asio.cpp
2>lib-asio.vcxproj -> C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\libs\beast\build\Debug\lib-asio.lib
3>------ Rebuild All started: Project: lib-beast, Configuration: Debug x64 ------
3>Building Custom Rule C:/drive_d/programming/projects/cpp/3rdparty/boost_1_75_0/libs/beast/CMakeLists.txt
3>lib_beast.cpp
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): error C2668: 'boost::asio::buffer_sequence_begin': ambiguous call to overloaded function
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/buffer.hpp(399): note: could be 'const boost::asio::const_buffer *boost::asio::buffer_sequence_begin<add_rvalue_reference<_Ty>::type>(const ConstBuffer &,enable_if<std::is_convertible<const add_rvalue_reference<_Ty>::type*,const boost::asio::const_buffer*>::value,void>::type *) noexcept'
3> with
3> [
3> _Ty=const unknown-type &,
3> ConstBuffer=add_rvalue_reference<const unknown-type&>::type
3> ]
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/buffer.hpp(389): note: or 'const boost::asio::mutable_buffer *boost::asio::buffer_sequence_begin<add_rvalue_reference<_Ty>::type>(const MutableBuffer &,enable_if<std::is_convertible<const add_rvalue_reference<_Ty>::type*,const boost::asio::mutable_buffer*>::value,void>::type *) noexcept'
3> with
3> [
3> _Ty=const unknown-type &,
3> MutableBuffer=add_rvalue_reference<const unknown-type&>::type
3> ]
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): note: while trying to match the argument list '(add_rvalue_reference<_Ty>::type)'
3> with
3> [
3> _Ty=const unknown-type &
3> ]
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): note: see reference to alias template instantiation 'buffers_iterator_type<unknown-type>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/http/chunk_encode.hpp(251): note: see reference to class template instantiation 'boost::beast::buffers_cat_view<boost::beast::http::detail::chunk_size,boost::asio::const_buffer,boost::beast::http::chunk_crlf>::const_iterator' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/relationship.hpp(474): note: see reference to class template instantiation 'boost::asio::execution::detail::relationship_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/outstanding_work.hpp(475): note: see reference to class template instantiation 'boost::asio::execution::detail::outstanding_work_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/occupancy.hpp(123): note: see reference to class template instantiation 'boost::asio::execution::detail::occupancy_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/mapping.hpp(604): note: see reference to class template instantiation 'boost::asio::execution::detail::mapping_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/context.hpp(130): note: see reference to class template instantiation 'boost::asio::execution::detail::context_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/bulk_guarantee.hpp(687): note: see reference to class template instantiation 'boost::asio::execution::detail::bulk_guarantee_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/blocking_adaptation.hpp(663): note: see reference to class template instantiation 'boost::asio::execution::detail::blocking_adaptation_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/blocking.hpp(836): note: see reference to class template instantiation 'boost::asio::execution::detail::blocking_t<0>' being compiled
3>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): error C3546: '...': there are no parameter packs available to expand
3>Done building project "lib-beast.vcxproj" -- FAILED.
4>------ Rebuild All started: Project: websocket-server-sync, Configuration: Debug x64 ------
4>Building Custom Rule C:/drive_d/programming/projects/cpp/3rdparty/boost_1_75_0/libs/beast/example/websocket/server/sync/CMakeLists.txt
4>websocket_server_sync.cpp
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): error C2668: 'boost::asio::buffer_sequence_begin': ambiguous call to overloaded function
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/buffer.hpp(399): note: could be 'const boost::asio::const_buffer *boost::asio::buffer_sequence_begin<add_rvalue_reference<_Ty>::type>(const ConstBuffer &,enable_if<std::is_convertible<const add_rvalue_reference<_Ty>::type*,const boost::asio::const_buffer*>::value,void>::type *) noexcept'
4> with
4> [
4> _Ty=const unknown-type &,
4> ConstBuffer=add_rvalue_reference<const unknown-type&>::type
4> ]
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/buffer.hpp(389): note: or 'const boost::asio::mutable_buffer *boost::asio::buffer_sequence_begin<add_rvalue_reference<_Ty>::type>(const MutableBuffer &,enable_if<std::is_convertible<const add_rvalue_reference<_Ty>::type*,const boost::asio::mutable_buffer*>::value,void>::type *) noexcept'
4> with
4> [
4> _Ty=const unknown-type &,
4> MutableBuffer=add_rvalue_reference<const unknown-type&>::type
4> ]
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/buffer_traits.hpp(123): note: while trying to match the argument list '(add_rvalue_reference<_Ty>::type)'
4> with
4> [
4> _Ty=const unknown-type &
4> ]
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): note: see reference to alias template instantiation 'buffers_iterator_type<unknown-type>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/http/chunk_encode.hpp(251): note: see reference to class template instantiation 'boost::beast::buffers_cat_view<boost::beast::http::detail::chunk_size,boost::asio::const_buffer,boost::beast::http::chunk_crlf>::const_iterator' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/relationship.hpp(474): note: see reference to class template instantiation 'boost::asio::execution::detail::relationship_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/outstanding_work.hpp(475): note: see reference to class template instantiation 'boost::asio::execution::detail::outstanding_work_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/occupancy.hpp(123): note: see reference to class template instantiation 'boost::asio::execution::detail::occupancy_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/mapping.hpp(604): note: see reference to class template instantiation 'boost::asio::execution::detail::mapping_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/context.hpp(130): note: see reference to class template instantiation 'boost::asio::execution::detail::context_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/bulk_guarantee.hpp(687): note: see reference to class template instantiation 'boost::asio::execution::detail::bulk_guarantee_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/blocking_adaptation.hpp(663): note: see reference to class template instantiation 'boost::asio::execution::detail::blocking_adaptation_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/asio/execution/blocking.hpp(836): note: see reference to class template instantiation 'boost::asio::execution::detail::blocking_t<0>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/core/impl/buffers_cat.hpp(127): error C3546: '...': there are no parameter packs available to expand
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/http/parser.hpp(56): error C2338: BodyReader type requirements not met
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/websocket/impl/handshake.hpp(48): note: see reference to class template instantiation 'boost::beast::http::parser<false,boost::beast::http::basic_string_body<char,std::char_traits<char>,std::allocator<char>>,std::allocator<char>>' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/websocket/impl/handshake.hpp(56): note: see reference to class template instantiation 'boost::beast::websocket::stream<NextLayer,deflateSupported>::handshake_op<Handler>::data' being compiled
4>C:\drive_d\programming\projects\cpprdparty\boost_1_75_0\boost/beast/websocket/impl/handshake.hpp(185): note: see reference to class template instantiation 'boost::beast::websocket::stream<NextLayer,deflateSupported>::handshake_op<Handler>' being compiled
4>Done building project "websocket-server-sync.vcxproj" -- FAILED.
========== Rebuild All: 2 succeeded, 2 failed, 0 skipped ==========
有人可以告诉我这里发生了什么或者我做错了什么吗?
我在 Boost Beast 项目的 Github 页面上也有 post 这个问题,我从一位维护者那里得到了一个答案,说很难编译 Boost Beast 示例项目,因为MSVS 2017 本身旧版本中的错误(请参阅 link 我的问题的答案)。结论是还是用MSVS 2019比较靠谱,在那边编译。
我也试过用 MSVS 2019 编译它并且它有效。
如果您无法更改 MSVS 版本,那么您应该联系维护人员来帮助您解决问题。对我来说,我的 MSVS 2017 版本(不是最新的 MSVS 2017 版本)在编译 Beast 时出现问题的信息就足够了。
更新:
关于使用 MSVS 2017 构建 Boost Beast,最新版本的 MSVS 2017 应该可以正常工作 (link here)。