Fatal Error: openssl/evp.h No such file or directory
Asked Answered
P

5

11

I successfully compiled openssl using android ndk build and .so files are built successfully.

I am trying to 'include' built .so files in an android project.

Getting an error in below line:

#include "openssl/evp.h"

fatal error: openssl/evp.h: No such file or directory compilation terminated. make: * [obj/local/armeabi/objs/iedemo/anotherdemo.o] Error 1

However, I am include stdio.h and string.h files.

I am explore /usr/include/openssl directory, I am able find all openssl related .h files here. And, stdio.h and string.h files are present in /usr/include directory.

I have installed libssl-dev package too. Command (sudo apt-get install libssl-dev)

Please help me!!

Pappose answered 23/10, 2012 at 6:13 Comment(0)
U
22

When encountering this problem on Debian or Ubuntu, it can be solved with the following command:

apt-get install libssl-dev

Ununa answered 21/5, 2018 at 15:59 Comment(0)
I
3

For people like me, that uses windows OS and they accidently came to this page and the above solutions did not solve their problem, can try the following solution:
I downloaded the OpenSSL executable from the official website, and selected the file with the description that contanins the following line (Recommended for software developers by the creators of OpenSSL).
At the time of writing this solution, the file version is (Win64 OpenSSL v3.0.0), and it can be directly downloaded from the following link.

Here is an Image for more declaration:
enter image description here

After that, I did the following steps:

  1. Install the OpenSSL form the .exe file.
  2. Copy the bin folder directory path (in my case it was C:\Program Files\OpenSSL-Win64\bin) and add it to the system enviroment variables.
  3. Copy the include folder directory path (in my case it was C:\Program Files\OpenSSL-Win64\include) and add it to the system enviroment variables.

Then compile the source code that used the openssl library and header files, they should be compiled with no errors.

Idolah answered 8/11, 2021 at 21:22 Comment(0)
P
2

I ran into this when building a PHP package using PECL and was able to install the header file as part of openssl-devel

On CentOS/RHEL: yum install openssl-devel

On Ubuntu/Debian: apt-get install openssl-devel

Piotrowski answered 28/7, 2017 at 6:23 Comment(2)
E: Unable to locate package openssl-develUnuna
on Ubuntu/Debian the package is called libssl-devMinimus
B
1

Your Android.mk should specify the openssl include directory (not /usr/include/openssl, but the one that goes with the files that you built for Android using NDK. Something similar to

LOCAL_C_INCLUDES += /home/Charan/openssl/include

But you will also need to specify the path for .so files that you have built, and make sure they are correctly deployed with your app. The things can go messy, but luckily there is a working example: openSSL using Android's NDK problems.

Bridgehead answered 23/10, 2012 at 21:47 Comment(1)
Yes Alex, u are right. I had done in the same way (trial and error method actually). I also copied files to be included into workspace and also specified path for .so file. Can easily messed up...Pappose
E
-1

To fix this error : E: Unable to locate package openssl-devel you need to add sudo in the beginning sudo apt-get install openssl-devel

Ethereal answered 16/11, 2023 at 10:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.