cmakeopensslubuntu-18.04cpp-netlib

CMake failing to build, can't find openssl


I'm trying to build cpp-netlib 0.12.0 stable in Ubuntu 18.04, but when I get to running

$ make -j4

I get a lot of errors, such as:

error: ‘SSL_R_SHORT_READ’ was not declared in this scope
         ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ)

Google told me this was because the make variables -DOPENSSL_INCLUDE_DIR and -DOPENSSL_SSL_LIBRARY need to be defined. However, I can't find the directories/libraries I need to set them to. Examples give /usr/lib/openssl-1.0 and /usr/include/openssl-1.0, but I can't find anything like those, even though I have the latest version of openssl installed through apt-get.

My /usr/include directory contains the folder 'openssl', but usr/lib doesn't have even that, only 'openssh', which doesn't appear to contain anything relevant.

How can I fix this?


Solution

  • Fixed by cloning latest version from git repository and building from that.