# SQLCipher static linking against another lib for Android

**URL:** <https://discuss.zetetic.net/t/sqlcipher-static-linking-against-another-lib-for-android/1499>\
**Category:** SQLCipher\
**Created:** [June 30, 2016, 5:23pm UTC](https://discuss.zetetic.net/t/sqlcipher-static-linking-against-another-lib-for-android/1499 "2016-06-30T17:23:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![artur](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@artur](https://discuss.zetetic.net/u/artur)\
**Post date:** [June 30, 2016, 5:23pm UTC](https://discuss.zetetic.net/t/sqlcipher-static-linking-against-another-lib-for-android/1499/1 "2016-06-30T17:23:12Z")

</div>

Hi, i’m trying to integrate SQLCipher into linphone-core for Android (linphone-core is a library not an Android app).  
I tried to compile the sqlcipher for Android statically, in the jni/Android.mk replaced:  
include (BUILD\_SHARED\_LIBRARY) with include (BUILD\_STATIC\_LIBRARY)

Compiled sqlcipher for android, was successful, the ‘.a’ files were on ‘obj’ directory

But when I compile the linphone-core (armeabi) with the libsqlcipher replacing the libsqlite3 it gives me errors linking:  
[1%] Linking CXX shared library [liblinphone-armeabi.so](http://liblinphone-armeabi.so)  
/opt/android\_studio/android-database-sqlcipher/jni/…/external/sqlcipher/sqlite3.c:18296: error: undefined reference to ‘RAND\_add’  
/opt/android\_studio/android-database-sqlcipher/jni/…/external/sqlcipher/sqlite3.c:18460: error: undefined reference to ‘EVP\_sha1’  
/opt/android\_studio/android-database-sqlcipher/jni/…/external/sqlcipher/sqlite3.c:18460: error: undefined reference to ‘EVP\_MD\_size’  
/opt/android\_studio/android-database-sqlcipher/jni/…/external/sqlcipher/sqlite3.c:18456: error: undefined reference  
(…)

My guess is that it didn’t statically link the libcrypto.a to libsqlcipher.a

So my question is how can I statically compile libsqlcipher for the various android archs with libcrypto statically linked ?  
Am I missing something here regarding compiling sqlcipher statically ?

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [June 30, 2016, 9:24pm UTC](https://discuss.zetetic.net/t/sqlcipher-static-linking-against-another-lib-for-android/1499/2 "2016-06-30T21:24:49Z")

</div>

Hello @artur

This sounds like a very specific build configuration issue. We only provide free, public support to our standard community distributions. If your organization is interested in advanced support agreement to provide further assistance with your build, please feel free to contact us at [support@zetetic.net](mailto:support@zetetic.net). Thanks!
