heroiclabs / nakama-cpp

Generic C/C++ client for Nakama server.
https://heroiclabs.com/docs/cpp-client-guide
Apache License 2.0
69 stars 25 forks source link

Build failing #57

Closed DanieleCalanna closed 2 years ago

DanieleCalanna commented 2 years ago

I'm trying to build using a different C++ Standard. After following the guide in your readme I'm getting this error:

BUILD_REST_CLIENT = True
BUILD_GRPC_CLIENT = False
BUILD_HTTP_CPPREST = True
BUILD_WEBSOCKET_CPPREST = True
BUILD_C_API = True
BUILD_NAKAMA_TESTS = False
copied nakama-cpp
copied nonstd
copied nakama-c
copied nakama-cpp-c-wrapper
Building for Arch: x64, Toolset: v142, Mode: Release, DLL: False
calling: ['cmake', '-B', 'G:\\nakama-cpp\\build\\windows\\build\\v142_x64', '-G', 'Visual Studio 16 2019', '-T', 'v142', '-DCMAKE_SYSTEM_VERSION=10.0', '-DCMAKE_BUILD_TYPE=Release', '-DNAKAMA_SHARED_LIBRARY=OFF', '-DBUILD_REST_CLIENT=ON', '-DBUILD_GRPC_CLIENT=OFF', '-DBUILD_HTTP_CPPREST=ON', '-DBUILD_WEBSOCKET_CPPREST=ON', '-DBUILD_C_API=ON', '-A', 'x64', '../..']
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.
-- The C compiler identification is MSVC 19.29.30141.0
-- The CXX compiler identification is MSVC 19.29.30141.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/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 (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM_NASM compiler identification is NASM
-- Found assembler: C:/Users/Daniele/AppData/Local/bin/NASM/nasm.exe
CMake Warning (dev) at third_party/grpc/third_party/protobuf/cmake/CMakeLists.txt:43 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'protobuf_BUILD_TESTS'.
This warning is for project developers.  Use -Wno-dev to suppress it.

--
-- 3.14.0.0
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.11")
-- Setting msvc options
-- websocketpp not found, using the embedded version
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: system date_time regex) (found version
  "1.69.0")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.23/Modules/FindBoost.cmake:2375 (find_package_handle_standard_args)
  third_party/cpprestsdk/Release/cmake/cpprest_find_boost.cmake:59 (find_package)
  third_party/cpprestsdk/Release/cmake/cpprest_find_websocketpp.cmake:17 (cpprest_find_boost)
  third_party/cpprestsdk/Release/src/CMakeLists.txt:68 (cpprest_find_websocketpp)

-- Configuring incomplete, errors occurred!
See also "G:/nakama-cpp/build/windows/build/v142_x64/CMakeFiles/CMakeOutput.log".
See also "G:/nakama-cpp/build/windows/build/v142_x64/CMakeFiles/CMakeError.log".

I've also installed NASM from the official site (this step is not mentioned in the readme) and set the environment variables for boost like this image

Can someone help me please?

lugehorsam commented 2 years ago

Hey @DanieleCalanna, have you installed all the required Boost library components as we've detailed in the README.md? That is:

./bootstrap.sh --with-libraries=system,chrono,thread
./b2
DanieleCalanna commented 2 years ago

Hey @DanieleCalanna, have you installed all the required Boost library components as we've detailed in the README.md? That is:

./bootstrap.sh --with-libraries=system,chrono,thread
./b2

Hi @lugehorsam, thanks for the answer. I'm building on windows. The readme only states:

lugehorsam commented 2 years ago

@DanieleCalanna okay, I would look at the Boost installation instructions for windows. They are analogous to other platforms:

https://valelab4.ucsf.edu/svn/3rdpartypublic/boost/more/getting_started/windows.html

For example, there is a bootstrap batch file that you need to run there. There may be a separate flag similar to what is shown in the Linux instructions for adding specific components of Boost.

DanieleCalanna commented 2 years ago

@DanieleCalanna okay, I would look at the Boost installation instructions for windows. They are analogous to other platforms:

https://valelab4.ucsf.edu/svn/3rdpartypublic/boost/more/getting_started/windows.html

For example, there is a bootstrap batch file that you need to run there. There may be a separate flag similar to what is shown in the Linux instructions for adding specific components of Boost.

I managed to run the bootstrap batch file and now it states I need Visual Studio 2017 and I'm currently running the 2019.

image

mofirouz commented 2 years ago

Thanks @DanieleCalanna - we are aware of the issue, and are reworking the build system entirely for this and will post an update in due time.

DanieleCalanna commented 2 years ago

I managed to build both boost and nakama-cpp to specify a different C++ standard. Thank you all.