Cannot build hello world

52 views
Skip to first unread message

ssg

unread,
Dec 21, 2020, 5:34:01 AM12/21/20
to The C++ Network Library
I am having trouble building the hello world server application

I am on Windows 10 and have Visual Studio 2017.

The latest boost 1_75_0 does not compile as it is missing asio/stream_socket_service.hpp. I therefore tried with 1_58_0, but I had trouble building it (seems more of a boost issue). So I tried with 1_67_0, and successfully executed bootstrap and .\b2 from the regular command prompt (it didn't seem to require the Developer command prompt).

I added two header paths (cpp=netlib and boost) and one lib path (boost only, as I had not compiled cp-netlib at that point). It all compiled and linked successfully till I added the line _server.run(), at which point it gave me a linker error for missing boost::network::http::parse_version.

So I gathered I have to build cpp-netlib. I created cpp-netlib-build as a sibling to boost_1_67_0 and cpp-netlib-0.13.0. From within  cpp-netlib-build  I ran cmake (I have  cmake 3.18.1): 
cmake -DCMAKE_BUILD_TYPE=Debug -DBOOST_ROOT=..\boost_1_67_0 ..\cpp-netlib-0.13.0
But cmake gives the following error:

-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19041.
-- The C compiler identification is MSVC 19.16.27043.0
-- The CXX compiler identification is MSVC 19.16.27043.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/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 (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Tools/cmake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find Boost (missing: system thread) (found suitable version
  "1.67.0", minimum required is "1.58.0")
Call Stack (most recent call first):
  C:/Tools/cmake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  C:/Tools/cmake/share/cmake-3.18/Modules/FindBoost.cmake:2177 (find_package_handle_standard_args)
  CMakeLists.txt:53 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/Users/<name>/Documents/cpp-server/cpp-netlib-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/<name>/Documents/cpp-server/cpp-netlib-build/CMakeFiles/CMakeError.log".

I have no idea how to fix this one, tried quite a bit to no avail. Could you please help?
Reply all
Reply to author
Forward
0 new messages