fatal error openssl/evp.h: No such file or directory : [Solved]

Updated on December 20, 2019

Did you ran into an error “fatal error openssl/evp.h” while installing openca-base-1.5.1 package? I did ran through few errors – Can’t locate module/load/conditional.pm, undefined subroutine Scalar::Util::blessed and addMessage failed for log slot XML. Fortunately, I was able to fix all of those errors and now with a new error in SSLeay.

Below is the complete error message.

[root@openra Net-SSLeay-1.40]# perl Makefile.PL
Cannot determine perl version info from lib/Net/SSLeay.pm
Cannot determine license info from lib/Net/SSLeay.pm
*** Found OpenSSL-1.0.2k installed in /usr
*** That's newer than what this module was tested with
 You should consider checking if there is a newer release of this module
 available. Everything will probably work OK, though.
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
 and Net::SSLeay. Mixing and matching compilers is not supported.
Generating a Unix-style Makefile
Writing Makefile for Net::SSLeay
Writing MYMETA.yml and MYMETA.json
[root@openra Net-SSLeay-1.40]# make
Skip blib/lib/Net/SSLeay.pm (unchanged)
Skip blib/lib/Net/SSLeay/Handle.pm (unchanged)
Running Mkbootstrap for SSLeay ()
chmod 644 "SSLeay.bs"
"/usr/bin/perl" "-Iinc" -MExtUtils::Command::MM -e 'cp_nonempty' -- SSLeay.bs blib/arch/auto/Net/SSLeay/SSLeay.bs 644
gcc -c -I/usr/include -I/usr/inc32 -I/usr/kerberos/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"1.40\" -DXS_VERSION=\"1.40\" -fPIC "-I/usr/lib64/perl5/CORE" SSLeay.c
SSLeay.xs:92:25: fatal error: openssl/evp.h: No such file or directory

How to fix fatal error openssl/evp.h No such file or directory

The header file evp.h generally comes with openssl-devel package. As the error message ‘evp.h no such file or directory’ indicates, installing openssl-devel package should solve the error. The openssl-devel package contains static libraries and include files needed to develop applications which support various cryptographic algorithms and protocols.

Install openssl devel as shown below:

CentOS/Redhat:

yum install openssl-devel

Ubuntu/Debain:

apt-get install libssl-dev

That’s It 🙂 Now try compiling openca-base package and it should work.

Was this article helpful?

Related Articles

Comments Leave a Comment

  1. Thank you! This happened to me in an old MacBook Pro (macOS Catalina) with Docker Toolbox.

  2. performed the apt-get install libssl-dev libssl-dev is already the newest version. still no openssl/evp.h

Leave a Comment