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

Last updated on August 19, 2020 by Dan Nanni

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]?

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.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean