0

I am running 64-bit Mint operating system using the Linux 5.4.0-58-generic kernel, and the OpenSSL version is v1.1.1f.

Tried both setting external environment variable OPENSSL_ROOT_DIR to /usr/lib/ssl and the cmake variable OPENSSL_ROOT_DIR to /usr/lib/ssl and the same error persists. I set OPENSSL_INCLUDE_DIR on the cmake configuration variables and it removed the "OPENSSL_INCLUDE_DIR" error. I am not sure where OPENSSL_ROOT_DIR should be or how the folder structure should look like (I have tried searching for the directory for a while now) so that would be great to know as well.

Here is the error I get:

-- Could NOT find Lua (missing: LUA_INCLUDE_DIR) 
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
  OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindOpenSSL.cmake:447 (find_package_handle_standard_args)
  CMakeLists.txt:74 (find_package)


-- Configuring incomplete, errors occurred!
Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
  • How have you installed OpenSSL? By using a package manager, or by building it from sources? – Tsyvarev Mar 06 '21 at 00:35
  • @Tsyvarev I do not remember. Should I reinstall at all using the package manager or building from sources? – user15339763 Mar 08 '21 at 15:09
  • You should give proper `OPENSSL_ROOT_DIR` hint for point to OpenSSL **installation prefix**. Directory `/usr/lib/ssl` is definitely wrong for that purpose. Proper prefix should point to the directory, which has `include/openssl/ssl.h` in it, and also should have `lib/` subdirectory with the OpenSSL library. – Tsyvarev Mar 08 '21 at 15:55
  • I figured out what the issue was. The program was not just asking for openssl, but also the development package which has the includes. I did not have them, so installing the necessary packages fixed the issue. (OPENSSL_ROOT_DIR must've been set when installing the packages) Thank you! – user15339763 Mar 09 '21 at 17:40
  • So, the problem is basically to understand what CMake wants from you by printing given message. The [duplicate question](https://stackoverflow.com/questions/16248775/cmake-not-able-to-find-openssl-library) has the same intention. If it doesn't have an answer describing the Linux Mint packages needed to be installed, then feel free to add your own answer. – Tsyvarev Mar 09 '21 at 18:15
  • Thank you so much, I will contribute. – user15339763 Mar 09 '21 at 18:55

0 Answers0