Skip to content Skip to sidebar Skip to footer

Android Ndk Openssl Error Cross-compiling

I am new in NDK and I am following this guide to build OpenSSL for Android, I am using Windows 7 and Cygwin for this. I'm having errors when trying to build the OpenSSL library. #

Solution 1:

When I try the make depend command I have 2 errors:

cryptlib.c:171:3: error: #error"Inconsistency between crypto.h and cryptlib.c"# error"Inconsistency between crypto.h and cryptlib.c"

There's a problem with the symlinks. Unpack the tarball again with tar zxvf. Then, verify the header files are not 0 length.

Also see Inconsistency between crypto.h and cryptlib.c on the OpenSSL mailing list. And How to copy symbolic link file from Linux to Windows and then back to Linux but still keeping it as a symbolic link on Stack Overflow.

Solution 2:

Using this guide and modifying the file setenv-android.sh you can easy compile openssl for arm, x86 and mips.

You just have to modify _ANDROID_NDK _ANDROID_ARCH _ANDROID_EABI _ANDROID_API parameters

note: for mips you'll have to add some lines in the file around

around line 120:

 arch-mips)   
  ANDROID_TOOLS="mipsel-linux-android-gcc mipsel-linux-android-ranlib mipsel-linux-android-ld"
;;

around line 200:

if [ "$_ANDROID_ARCH" == "arch-mips" ]; thenexport MACHINE=mipsel
   export RELEASE=2.6.37
   export SYSTEM=android
   export ARCH=mips
   export CROSS_COMPILE="mipsel-linux-android-"fi

if you follow the guide you'll have libcrypto.a, libssl.a, libcrypto.so and libssl.so.

if you want the libraries for 64 bits architecture you can do a pull from a device using adb, all android device have libcrypto.so and libssl.so in /system/lib64 for 64bits version (only in a 64bits device), and /system/lib the 32bits version, you can use an emulator for that, if you can want the 64bits version of the static libraries (libcrypto.a and libssl.a) in this link you can find the way to do it.

Post a Comment for "Android Ndk Openssl Error Cross-compiling"