ivanmejiarocha / micro-service

sample micro-service in C++
MIT License
263 stars 129 forks source link

Possible incompatibility with boost 1.66.0 ("solved") #3

Closed devmaximilian closed 6 years ago

devmaximilian commented 6 years ago

I'm writing this in the rare case that anyone else runs into the same issue that I faced using macOS High Sierra.

I really appreciate this project since it makes getting into C++ REST API building really simple. However, I ran into an issue when trying to compile the code on macOS 10.13.3. It kept complaining about no rule to include the openssl libs. After a lot of searching and tinkering I realised the problem had nothing to do with openssl, the CMake command was throwing warnings that I (ignorantly) ignored. After some messing with brew and the boost version everything compiled without a hitch.

It seems like (based on my very limited knowledge) that boost 1.66.0 lacks some of the dependencies required.

This is what I did to fix the issue:

... and that's it. After that everything compiled as it should.

ivanmejiarocha commented 6 years ago

Hi devmaximillian, Not sure which dependencies errors you found, but I am glad you could find the issue on your side and fix it. Boost 1.66 is the latest version at this time of boost libraries so yeah is possible to have some issues and although one can always install previous versions of Boost, is good to know how to fix the issues with the latest version.

Thanks a lot, Ivan.

causevic commented 6 years ago

These are the changes I had to do to make this work with latest versions: XCode 9.4, boost 1.67 and openssl 1.0.2o

  1. File: ./micro-service/libs/cpprestsdk/Release/CMakeLists.txt (plus split build_dependencies.sh into steps: 1. checkout ; 2. add suppress warnings as below 3.build/cmake) set(OSX_SUPPRESSIONS -Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-unused-local-typedefs -Wno-delete-non-virtual-dtor -Wno-unused-lambda-capture) set(WARNINGS -Wall -Wextra -Wunused-parameter -Wcast-align -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls -Wunreachable-code -Wno-format-truncation)
  2. File: ./micro-service/libs//cpprestsdk/Release/libs/websocketpp/websocketpp/transport/asio/connection.hpp if (config::enable_multithreading) { m_strand = lib::make_shared(
  3. ./micro-service/CMakeLists.txt find_package(OpenSSL 1.0.2 REQUIRED) set(OPENSSL_VERSION "1.0.2o_2")

"1." is due to XCode / clang "2." is due to boost "3." is due to openssl

ivanmejiarocha commented 6 years ago

@causevic and @devmaximilian FYI, I have updated the scripts to build the project addressing the issues reported here and in #4 and #5, please give it a spin.

Thanks, Ivan