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

Can't compile the echo_client example #1120

Closed
GEOEGII555 opened this issue Jan 4, 2024 · 0 comments
Closed

Can't compile the echo_client example #1120

GEOEGII555 opened this issue Jan 4, 2024 · 0 comments

Comments

@GEOEGII555
Copy link

GEOEGII555 commented Jan 4, 2024

I want to compile the echo_client example. My CMakeLists.txt is:

cmake_minimum_required (VERSION 3.8)

if (POLICY CMP0141)
  cmake_policy(SET CMP0141 NEW)
  set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

project ("service")

find_package(OpenSSL REQUIRED)
find_package(Boost REQUIRED)
find_package(websocketpp REQUIRED)

add_executable (service "echo_client.cpp")
target_link_libraries(service OpenSSL::SSL Boost websocketpp::websocketpp)

if (CMAKE_VERSION VERSION_GREATER 3.12)
  set_property(TARGET service PROPERTY CXX_STANDARD 20)
endif()

The commands that I ran:

"D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
mkdir build
cd build
cmake ..
msbuild ALL_BUILD.vcxproj

The error:

Версия MSBuild 17.7.2+d6990bcfa для .NET Framework
Сборка начата 04.01.2024 22:34:55.

Проект "D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\ALL_BUILD.vcxproj" в узле 1 (целевые объект
ы по умолчанию).
Проект "D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\ALL_BUILD.vcxproj" (1) выполняет сборку "D:
\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\ZERO_CHECK.vcxproj" (2) в узле 1 (целевые объекты по
умолчанию).
PrepareForBuild:
  Создание каталога "x64\Debug\ZERO_CHECK\".
  Создание каталога "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\".
InitializeBuildStatus:
  Создание "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild", так как было задано "AlwaysCreate".
  Обращение к "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
CustomBuild:
  1>Checking Build System
FinalizeBuildStatus:
  Файл "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" удаляется.
  Обращение к "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Сборка проекта "D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\ZERO_CHECK.vcxproj" завершена (целе
вые объекты по умолчанию).

Проект "D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\ALL_BUILD.vcxproj" (1) выполняет сборку "D:
\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\service.vcxproj" (3) в узле 1 (целевые объекты по умо
лчанию).
PrepareForBuild:
  Создание каталога "service.dir\Debug\".
  Создание каталога "D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\Debug\".
  Создание каталога "service.dir\Debug\service.tlog\".
InitializeBuildStatus:
  Создание "service.dir\Debug\service.tlog\unsuccessfulbuild", так как было задано "AlwaysCreate".
  Обращение к "service.dir\Debug\service.tlog\unsuccessfulbuild".
CustomBuild:
  Building Custom Rule D:/GEOEGII555/Code/Libraries/websocketpp/examples/echo_client/CMakeLists.txt
ClCompile:
  D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64\CL.exe /c /ZI /nolo
  go /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /EHsc /RTC1 /
  MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++20 /Fo"service.dir\Debug\\" /Fd"service.dir\Debug
  \vc143.pdb" /external:W0 /Gd /TP /errorReport:queue  /external:I "C:/Program Files/OpenSSL/include" /external:I "C:/P
  rogram Files/websocketpp/include" D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\echo_client.cpp
  echo_client.cpp
C:\Program Files\websocketpp\include\websocketpp\common\random.hpp(56,14): fatal  error C1083: Не удается открыть файл
включение: boost/version.hpp: No such file or directory, [D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client
\build\service.vcxproj]
Сборка проекта "D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\service.vcxproj" завершена (целевые
 объекты по умолчанию) с ошибкой.

Сборка проекта "D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\ALL_BUILD.vcxproj" завершена (целев
ые объекты по умолчанию) с ошибкой.


Ошибка сборки.

"D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\ALL_BUILD.vcxproj" (целевой объект по умолчанию) (
1) ->
"D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_client\build\service.vcxproj" (целевой объект по умолчанию) (3)
 ->
(Целевой объект ClCompile) ->
  C:\Program Files\websocketpp\include\websocketpp\common\random.hpp(56,14): fatal  error C1083: Не удается открыть фай
л включение: boost/version.hpp: No such file or directory, [D:\GEOEGII555\Code\Libraries\websocketpp\examples\echo_clie
nt\build\service.vcxproj]

    Предупреждений: 0
    Ошибок: 1

Прошло времени 00:00:11.71

And the CMake log (I have boost installed):

-- Building for: Visual Studio 17 2022
-- The C compiler identification is MSVC 19.37.32825.0
-- The CXX compiler identification is MSVC 19.37.32825.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/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:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: C:/Program Files/OpenSSL/lib/libcrypto.lib (found version "3.3.0")
-- Found Boost: C:/Program Files/boost/boost_1_83_0 (found version "1.84.0")
-- Configuring done (33.2s)
-- Generating done (0.3s)
-- Build files have been written to: D:/GEOEGII555/Code/Libraries/websocketpp/examples/echo_client/build

I'm not sure what's going on, and why it needs the Boost library.

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

1 participant