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!!
When encountering this problem on Debian or Ubuntu, it can be solved with the following command:
apt-get install libssl-dev
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:
After that, I did the following steps:
Then compile the source code that used the openssl library and header files, they should be compiled with no errors.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With