How to fix “fatal error: openssl/aes.h: No such file or directory”

Question: I am trying to compile a program on Linux, but the compilation fails with an error saying: "fatal error: openssl/aes.h: No such file or directory". How can I install the requested header file and solve this problem on [insert your Linux distro]?
fatal error: openssl/aes.h: No such file or directory

If you encounter this error during compilation, this is because of the following: The program you are trying to build is using OpenSSL, but necessary development files (libraries and header files) required to link with OpenSSL are missing on your Linux platform.

To fix this problem, you have to install OpenSSL development package, which is available in standard repositories of all modern Linux distributions.

To install OpenSSL development package on Debian, Ubuntu or their derivatives:

$ sudo apt-get install libssl-dev

To install OpenSSL development package on Fedora, CentOS or RHEL:

$ sudo yum install openssl-devel

After installing the package, try recompiling the program.

Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

Leave a comment

Your email address will not be published. Required fields are marked *