使用示例构建websocketpp时出现链接错误 [英] Link errors when building websocketpp with examples

查看:985
本文介绍了使用示例构建websocketpp时出现链接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Windows 10上的示例构建 websocketpp 时遇到问题.

I'm having problems building websocketpp with examples on Windows 10.

这是我的工作:

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

I first open the CMake GUI, and specify "D:/third-party-software/websocketpp" (which is the directory to which I have cloned websocketpp) as the location of the source code and "D:/third-party-software/websocketpp/build" as the place to build the binaries.

然后,我按下按钮 Configure ,它询问我是否要创建构建文件夹,选择要创建的文件夹,然后要为项目使用哪个生成器以及任何可选工具集的使用方式(-T的参数)以及要使用的编译器,为此我分别选择了"Visual Studio 15 2017 Win64",没有可选的工具集(空字符串)和使用默认的本机编译器".

Then I press the button Configure, which asks me if I want to create the build folder, which I choose to do, and then which generator I want to use for the project, any optional toolset to use (argument to -T), and which compiler to use, for which I choose "Visual Studio 15 2017 Win64", no optional toolset (empty string), and "use default native compiler", respectively.

然后我设置以下参数:

  • BUILD_EXAMPLES:< enabled>
  • 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",
    分别针对原子库,计时库,date_time库,random库,系统库和线程库
  • 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"
  • BUILD_EXAMPLES: <enabled>
  • BOOST_ROOT: "C:/Program1/boost/boost_1_67_0"
  • Boost_<LIBRARY-NAME>_LIBRARY_DEBUG and
    BOOST_<LIBRARY-NAME>_LIBRARY_RELEASE:
    "C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_<library-name>-vc141-mt-gd-x64-1_67.lib" and
    "C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1/boost_<library-name>-vc141-mt-x64-1_67.lib",
    respectively, for the libraries atomic, chrono, date_time, random, system and thread
  • Boost_INCLUDE_DIR: "C:/Program1/boost/boost_1_67_0/"
  • Boost_LIBRARY_DIR_DEBUG and Boost_LIBRARY_DIR_RELEASE: "C:/Program1/boost/boost_1_67_0/lib64-msvc-14.1"

(我未初始化Boost_DIR)

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

Then I press Configure again, which gives the output

* 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中打开解决方案).

I the press Generate, which creates the Visual Studio solution, and Open Project, which opens the solution in Visual Studio 2017.

(我不知道终端中对应于这些按钮的命令是什么.)

(I don't know what commands pressing each of these buttons would correspond to in the terminal.)

在Visual Studio中,我右键单击目标 INSTALL ,然后单击 Build ,然后执行两次(以消除很多多余的输出).这是我第二次执行以下操作的结果:

In Visual Studio, I right-click on the target INSTALL and click Build, and do that twice (to get rid of a lot of superfluous output). This results in the following output the second time I do it:

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,但找不到它们.我该如何解决?

It seems like the linker is looking for the symbols __imp_htons, __imp_htonl and __imp_ntohs but cannot find them. How do I fix this?

推荐答案

如果您拥有Boost 1.67,它已经随WebSockets一起提供,则不需要websocketpp: https://www.boost.org/doc/libs/1_69_0/libs/beast/doc/html/index.html

If you have Boost 1.67 it comes with WebSockets already, you don't need websocketpp: https://www.boost.org/doc/libs/1_69_0/libs/beast/doc/html/index.html

这篇关于使用示例构建websocketpp时出现链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆