UnesBeig19
UnesBeig19

Reputation: 37

Receiving error about OpenSSL when trying to run step 3 of installing Socket.IO C++ Client

I want to install Socket.IO C++ Client from https://github.com/socketio/socket.io-client-cpp, but I have some difficulties following the steps from https://github.com/socketio/socket.io-client-cpp/blob/master/INSTALL.md. I have successfully installed Boost version 1_73_0 (step 1) and run step 2. Boost is installed at /Users/Home/Documents/boost_1_73_0. The socket.io C++ client is at /Users/Home/Documents/socket.io-client-cpp

When I run step 3 with this code:

(base) MacBook-Pro-7:socket.io-client-cpp Home$ cmake -DBOOST_ROOT:STRING=/Users/Home/Documents/boost_1_73_0 -DBOOST_VER:STRING=1_73_0 ./

I receive the following error:

-- not define build type, set to release
CMake Error at CMakeLists.txt:23 (find_package):
  find_package called with invalid argument "1_73_0"


-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR) 
-- Configuring incomplete, errors occurred!
See also "/Users/Home/Documents/GitHub/socket.io-client-cpp/CMakeFiles/CMakeOutput.log".

I tried to install openssl with brew install openssl in the directory as well, but I still receive the same error. I would appreciate it if you clarify what should I do.

Upvotes: 2

Views: 234

Answers (1)

Kevin
Kevin

Reputation: 18343

The contents of the BOOST_VER cache variable in the cmake command line are provided to CMake's find_package command as an argument:

1_73_0

However, per the find_package documentation, the format must use periods to separate the version components:

The [version] argument requests a version with which the package found should be compatible (format is major[.minor[.patch[.tweak]]])

Just change the cmake command line to conform to the required version format:

cmake -DBOOST_ROOT:STRING=/Users/Home/Documents/boost_1_73_0 -DBOOST_VER:STRING=1.73.0 ./

Upvotes: 2

Related Questions