JMR
JMR

Reputation: 765

"openssl/aes.h: No such file or directory" under Android

I'm trying to compile to android environment. And because of that I get the following error:

error: openssl/aes.h: No such file or directory

I find some solution in stack but, I don't get how to end the process to be able to compile.

I already compiled one version of openssl were should I add the libs? or how can I generate the *.a?

Do you know how can I add this library to the arm-linux-androideabi-g++ that I need to run to be able to pass this problem?

Upvotes: 0

Views: 2352

Answers (2)

noktigula
noktigula

Reputation: 445

Here you can find openssl includes: openssl

Download this includes and put them in some folder in your project, i.e. project_dir/module_dir/jni/openssl-includes.

Then you need set a LOCAL_C_INCLUDES variable in your Android.mk (which also is in jni folder: LOCAL_C_INCLUDES += ./openssl-includes

After that, you can include files in openssl-includes folder directly by name, i.e.:

#include <aes.h>

If you need an *.a file as output, you should include BUILD_STATIC_LIBRARY in Android.mk, if you need a *.so lib, include BUILD_SHARED_LIBRARY.

Upvotes: 1

Mandar
Mandar

Reputation: 1044

[1] Get openssl library which has aes.h file in its include folder.

[2] If you have compiled openssl library in your lib folder then add to -lssl or -lopenssl to your command line.

Upvotes: 1

Related Questions