0

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?

1

2 Answers 2

1

[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.

3
  • but where i can add? That is the problem :(
    – JMR
    Feb 17, 2016 at 15:19
  • 1
    try compiling somewhat like: gcc -I/home/src/openssl/include -L/home/src/openssl/lib -lssl -lcrypto
    – Mandar
    Feb 17, 2016 at 18:40
  • just make sure you have .lib files in openssl lib folder
    – Mandar
    Feb 17, 2016 at 18:51
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.