gpt4 book ai didi

c++ - 使用示例构建 websocketpp 时出现链接错误

转载 作者:行者123 更新时间:2023-11-30 02:16:28 29 4
gpt4 key购买 nike

我在构建 websocketpp 时遇到问题以及 Windows 10 上的示例。

这是我的做法:

我首先打开 CMake GUI,并指定“D:/third-party-software/websocketpp”(这是我将 websocketpp 克隆到的目录)作为源代码的位置,“D:/third- party-software/websocketpp/build”作为构建二进制文件的地方。

然后我按下按钮 Configure,它会询问我是否要创建构建文件夹,我选择这样做,然后我想为项目使用哪个生成器,任何可选的工具集使用(-T 的参数),以及使用哪个编译器,我分别选择“Visual Studio 15 2017 Win64”、无可选工具集(空字符串)和“使用默认 native 编译器”。

然后我设置以下参数:

  • BUILD_EXAMPLES : <启用>
  • BOOST_ROOT : "C:/Program1/boost/boost_1_67_0"
  • Boost_<LIBRARY-NAME>_LIBRARY_DEBUG
    BOOST_<LIBRARY-NAME>_LIBRARY_RELEASE :
    “C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_ -vc141-mt-gd-x64-1_67.lib”和
    "C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_<库名>-vc141-mt-x64-1_67.lib",
    分别为库 atomic、chrono、date_time、random、system 和 thread
  • Boost_INCLUDE_DIR : "C:/Program1/boost/boost_1_67_0/"
  • Boost_LIBRARY_DIR_DEBUGBoost_LIBRARY_DIR_RELEASE : "C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1"

(我保留 Boost_DIR 未初始化)

然后我再次按下Configure,这给出了输出

* Configuring Boost
-- Using BOOST_ROOT
C:/Program1/boost/boost_1_67_0
-- Include Directories
C:/Program1/boost/boost_1_67_0/
-- Library Directories
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1
-- Libraries
optimized
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_system-vc141-mt-x64-1_67.lib
debug
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_system-vc141-mt-gd-x64-1_67.lib
optimized
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_thread-vc141-mt-x64-1_67.lib
debug
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_thread-vc141-mt-gd-x64-1_67.lib
optimized
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_random-vc141-mt-x64-1_67.lib
debug
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_random-vc141-mt-gd-x64-1_67.lib
optimized
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_chrono-vc141-mt-x64-1_67.lib
debug
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_chrono-vc141-mt-gd-x64-1_67.lib
optimized
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_date_time-vc141-mt-x64-1_67.lib
debug
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_date_time-vc141-mt-gd-x64-1_67.lib
optimized
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_atomic-vc141-mt-x64-1_67.lib
debug
C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_atomic-vc141-mt-gd-x64-1_67.lib

** websocketpp
** associative_storage
-- Build Type:
EXECUTABLE
** broadcast_server
-- Build Type:
EXECUTABLE
** debug_client
-- Build Type:
EXECUTABLE
** debug_server
-- Build Type:
EXECUTABLE
** echo_client
-- Build Type:
EXECUTABLE
** echo_server
-- Build Type:
EXECUTABLE
** echo_server_both
-- Build Type:
EXECUTABLE
** echo_server_tls
-- Build Type:
EXECUTABLE
** enriched_storage
-- Build Type:
EXECUTABLE
** external_io_service
-- Build Type:
EXECUTABLE
** handler_switch
-- Build Type:
EXECUTABLE
** iostream_server
-- Build Type:
EXECUTABLE
** print_client
-- Build Type:
EXECUTABLE
** print_client_tls
-- Build Type:
EXECUTABLE
** print_server
-- Build Type:
EXECUTABLE
** simple_broadcast_server
-- Build Type:
EXECUTABLE
** sip_client
-- Build Type:
EXECUTABLE
** subprotocol_server
-- Build Type:
EXECUTABLE
** telemetry_client
-- Build Type:
EXECUTABLE
** telemetry_server
-- Build Type:
EXECUTABLE
** testee_client
-- Build Type:
EXECUTABLE
** testee_server
-- Build Type:
EXECUTABLE
** utility_client
-- Build Type:
EXECUTABLE

=========== Used Build Configuration =============

ENABLE_CPP11 = ON
BUILD_EXAMPLES = ON
BUILD_TESTS = OFF

WEBSOCKETPP_ROOT = D:/third-party-software/websocketpp
WEBSOCKETPP_BIN = D:/third-party-software/websocketpp/build/bin
WEBSOCKETPP_LIB = D:/third-party-software/websocketpp/build/lib
Install prefix = D:/third-party-software/websocketpp/install

WEBSOCKETPP_BOOST_LIBS = system;thread;random
WEBSOCKETPP_PLATFORM_LIBS =
WEBSOCKETPP_PLATFORM_TLS_LIBS =

OPENSSL_FOUND = TRUE
OPENSSL_INCLUDE_DIR = C:/Program1/GDAL/release-1911-x64-dev/release-1911-x64/include
OPENSSL_LIBRARIES = C:/Program1/GDAL/release-1911-x64-dev/release-1911-x64/lib/ssleay32.lib;C:/Program1/GDAL/release-1911-x64-dev/release-1911-x64/lib/libeay32.lib
OPENSSL_VERSION = 1.0.1h

Configuring done

我按下 Generate 以创建 Visual Studio 解决方案,然后按下 Open Project 以在 Visual Studio 2017 中打开解决方案。

(我不知道在终端中按下这些按钮中的每一个会对应什么命令。)

在 Visual Studio 中,我右键单击目标 INSTALL 并单击 Build,然后执行两次(以去除大量多余的输出)。这导致我第二次执行以下输出:

1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
2>------ Build started: Project: debug_server, Configuration: Release x64 ------
3>------ Build started: Project: iostream_server, Configuration: Release x64 ------
4>------ Build started: Project: print_client_tls, Configuration: Release x64 ------
2>cl : Command line warning D9002: ignoring unknown option '/arch:SSE2'
2>debug_server.cpp
4>cl : Command line warning D9002: ignoring unknown option '/arch:SSE2'
4>print_client_tls.cpp
3>iostream_server.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
3>iostream_server.obj : error LNK2001: unresolved external symbol __imp_htons
3>iostream_server.obj : error LNK2001: unresolved external symbol __imp_htonl
3>iostream_server.obj : error LNK2001: unresolved external symbol __imp_ntohs
3>D:\third-party-software\websocketpp\build\bin\Release\iostream_server.exe : fatal error LNK1120: 3 unresolved externals
3>Done building project "iostream_server.vcxproj" -- FAILED.
2>D:\third-party-software\websocketpp\websocketpp/frame.hpp(834): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data
4>D:\third-party-software\websocketpp\websocketpp/frame.hpp(834): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data
2>D:\third-party-software\websocketpp\websocketpp/logger/syslog.hpp(34): fatal error C1083: Cannot open include file: 'syslog.h': No such file or directory
4>D:\third-party-software\websocketpp\websocketpp/common/md5.hpp(367): warning C4267: '+=': conversion from 'size_t' to 'websocketpp::md5::md5_word_t', possible loss of data
4>D:\third-party-software\websocketpp\websocketpp/sha1/sha1.hpp(176): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
4>D:\third-party-software\websocketpp\examples\print_client_tls\print_client_tls.cpp(71): error C3861: 'strcasecmp': identifier not found
4>D:\third-party-software\websocketpp\examples\print_client_tls\print_client_tls.cpp(106): error C3861: 'strcasecmp': identifier not found
2>Done building project "debug_server.vcxproj" -- FAILED.
4>Done building project "print_client_tls.vcxproj" -- FAILED.
5>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
6>------ Build started: Project: INSTALL, Configuration: Release x64 ------
6>-- Install configuration: "Release"
6>-- Up-to-date: D:/third-party-software/websocketpp/install/cmake/websocketpp-config.cmake
6>-- Up-to-date: D:/third-party-software/websocketpp/install/cmake/websocketpp-configVersion.cmake
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/base64
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/base64/base64.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/client.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/close.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/asio.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/asio_ssl.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/chrono.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/connection_hdl.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/cpp11.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/functional.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/md5.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/memory.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/network.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/platforms.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/random.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/regex.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/stdint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/system_error.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/thread.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/time.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/common/type_traits.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/concurrency
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/concurrency/basic.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/concurrency/none.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/asio.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/asio_client.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/asio_no_tls.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/asio_no_tls_client.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/boost_config.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/core.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/core_client.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/debug.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/debug_asio.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/debug_asio_no_tls.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/minimal_client.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/config/minimal_server.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/connection.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/connection_base.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/endpoint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/endpoint_base.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/error.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/extensions
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/extensions/extension.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/extensions/permessage_deflate
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/extensions/permessage_deflate/disabled.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/extensions/permessage_deflate/enabled.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/frame.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http/constants.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http/impl
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http/impl/parser.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http/impl/request.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http/impl/response.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http/parser.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http/request.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/http/response.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/impl
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/impl/connection_impl.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/impl/endpoint_impl.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/impl/utilities_impl.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/logger
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/logger/basic.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/logger/levels.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/logger/stub.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/logger/syslog.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/message_buffer
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/message_buffer/alloc.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/message_buffer/message.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/message_buffer/pool.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/processors
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/processors/base.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/processors/hybi00.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/processors/hybi07.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/processors/hybi08.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/processors/hybi13.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/processors/processor.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/random
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/random/none.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/random/random_device.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/roles
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/roles/client_endpoint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/roles/server_endpoint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/server.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/sha1
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/sha1/sha1.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/asio
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/asio/base.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/asio/connection.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/asio/endpoint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/asio/security
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/asio/security/base.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/asio/security/none.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/asio/security/tls.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/base
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/base/connection.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/base/endpoint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/debug
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/debug/base.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/debug/connection.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/debug/endpoint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/iostream
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/iostream/base.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/iostream/connection.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/iostream/endpoint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/stub
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/stub/base.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/stub/connection.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/transport/stub/endpoint.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/uri.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/utf8_validator.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/utilities.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/include//websocketpp/version.hpp
6>-- Up-to-date: D:/third-party-software/websocketpp/install/bin/associative_storage.exe
6>-- Up-to-date: D:/third-party-software/websocketpp/install/bin/broadcast_server.exe
6>-- Up-to-date: D:/third-party-software/websocketpp/install/bin/debug_client.exe
6>CMake Error at examples/debug_server/cmake_install.cmake:37 (file):
6> file INSTALL cannot find
6> "D:/third-party-software/websocketpp/build/bin/Release/debug_server.exe".
6>Call Stack (most recent call first):
6> cmake_install.cmake:56 (include)
6>
6>
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "setlocal
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmEnd
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmErrorLevel
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: exit /b %1
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmDone
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 1.
6>Done building project "INSTALL.vcxproj" -- FAILED.
========== Build: 2 succeeded, 4 failed, 20 up-to-date, 0 skipped ==========

看起来链接器正在寻找符号 __imp_htons , __imp_htonl__imp_ntohs但找不到他们。我该如何解决这个问题?

最佳答案

如果你有 Boost 1.67,它已经带有 WebSockets,你不需要 websocketpp: https://www.boost.org/doc/libs/1_69_0/libs/beast/doc/html/index.html

关于c++ - 使用示例构建 websocketpp 时出现链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54829251/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com