# Problem compiling SQLcipher!

**URL:** <https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409>\
**Category:** SQLCipher\
**Created:** [October 17, 2017, 12:21pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409 "2017-10-17T12:21:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ducarpit](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/ducarpit/32/367_2.png) [@ducarpit](https://discuss.zetetic.net/u/ducarpit)\
**Post date:** [October 17, 2017, 12:21pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/1 "2017-10-17T12:21:07Z")

</div>

Hi,  
i am trying to compile SQLCipher in Ubuntu, but i got this errore when i run the make command:

```
./.libs/libsqlcipher.so: undefined reference to `OPENSSL_init_crypto'
./.libs/libsqlcipher.so: undefined reference to `HMAC_CTX_new'
./.libs/libsqlcipher.so: undefined reference to `HMAC_CTX_free'
collect2: error: ld returned 1 exit status
Makefile:611: set di istruzioni per l'obiettivo "sqlcipher" non riuscito
make: *** [sqlcipher] Errore 1

```

I tried to instal openssl-dev but it still not work…

Then i tried with this:

`./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="/usr/lib/x86_64-linux-gnu/libcrypto.a"`

But i got this other error when i run the make command:

```
*** Warning: Linking the shared library libsqlcipher.la against the
*** static library /usr/lib/x86_64-linux-gnu/libcrypto.a is not portable!
libtool: link: gcc -shared -fPIC -DPIC .libs/sqlite3.o /usr/lib/x86_64-linux-gnu/libcrypto.a -ldl -lcrypto -lpthread -Wl,-soname -Wl,libsqlcipher.so.0 -o .libs/libsqlcipher.so.0.8.6
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(obj_dat.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-gnu/libcrypto.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:600: set di istruzioni per l'obiettivo "libsqlcipher.la" non riuscito
make: *** [libsqlcipher.la] Errore 1

```

How can i solve this?  
Thanks

---

<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:** [October 17, 2017, 1:07pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/2 "2017-10-17T13:07:02Z")

</div>

Hi @ducarpit

What version of OpenSSL libraries do you have installed on your Ubuntu machine?

---

<div class="post-metadata">

**Author:** ![ducarpit](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/ducarpit/32/367_2.png) [@ducarpit](https://discuss.zetetic.net/u/ducarpit)\
**Post date:** [October 17, 2017, 1:53pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/4 "2017-10-17T13:53:26Z")

</div>

```
openssl:
  Installato: 1.0.2g-1ubuntu4.8
  Candidato: 1.0.2g-1ubuntu4.8
  Tabella versione:
 *** 1.0.2g-1ubuntu4.8 500
        500 http://it.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.0.2g-1ubuntu4.6 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     1.0.2g-1ubuntu4 500
        500 http://it.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
```

---

<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:** [October 17, 2017, 2:50pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/5 "2017-10-17T14:50:39Z")

</div>

Hi @ducarpit,

It looks like it is attempting to build with both a shared library, and a static library. Would you mind making a small adjustment to your configure step:

```auto
./configure --with-crypto-lib=none \
                --disable-tcl \
                --disable-shared \ 
                --enable-static=yes \ 
                --enable-tempstore=yes \
                CFLAGS="-DSQLITE_HAS_CODEC \
                        -DSQLCIPHER_CRYPTO_OPENSSL" \
                LDFLAGS="/usr/lib/x86_64-linux-gnu/libcrypto.a"

```

Then run the following:

```auto
make clean
make

```

If that doesn’t address the relocation warning, you may need to build OpenSSL from source using the `-fPIC` flag.

---

<div class="post-metadata">

**Author:** ![ducarpit](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/ducarpit/32/367_2.png) [@ducarpit](https://discuss.zetetic.net/u/ducarpit)\
**Post date:** [October 17, 2017, 4:09pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/6 "2017-10-17T16:09:25Z")

</div>

Hi, with the command you suggest i have new errors:

```
    ./.libs/libsqlcipher.a(sqlite3.o): In function `HMAC_CTX_new':
    sqlite3.c:(.text+0x49ee): undefined reference to `CRYPTO_malloc'
    sqlite3.c:(.text+0x4a05): undefined reference to `HMAC_CTX_init'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `HMAC_CTX_free':
    sqlite3.c:(.text+0x4a2a): undefined reference to `HMAC_CTX_cleanup'
    sqlite3.c:(.text+0x4a36): undefined reference to `CRYPTO_free'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_add_random':
    sqlite3.c:(.text+0x4a70): undefined reference to `RAND_add'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_activate':
    sqlite3.c:(.text+0x4aba): undefined reference to `EVP_get_cipherbyname'
    sqlite3.c:(.text+0x4ae2): undefined reference to `OPENSSL_add_all_algorithms_noconf'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_deactivate':
    sqlite3.c:(.text+0x4b6d): undefined reference to `EVP_cleanup'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_random':
    sqlite3.c:(.text+0x4c08): undefined reference to `RAND_bytes'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_hmac':
    sqlite3.c:(.text+0x4c78): undefined reference to `EVP_sha1'
    sqlite3.c:(.text+0x4c94): undefined reference to `HMAC_Init_ex'
    sqlite3.c:(.text+0x4cad): undefined reference to `HMAC_Update'
    sqlite3.c:(.text+0x4cc6): undefined reference to `HMAC_Update'
    sqlite3.c:(.text+0x4cdd): undefined reference to `HMAC_Final'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_kdf':
    sqlite3.c:(.text+0x4d4a): undefined reference to `PKCS5_PBKDF2_HMAC_SHA1'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_cipher':
    sqlite3.c:(.text+0x4d8f): undefined reference to `EVP_CIPHER_CTX_new'
    sqlite3.c:(.text+0x4dcd): undefined reference to `EVP_CipherInit_ex'
    sqlite3.c:(.text+0x4dde): undefined reference to `EVP_CIPHER_CTX_set_padding'
    sqlite3.c:(.text+0x4e08): undefined reference to `EVP_CipherInit_ex'
    sqlite3.c:(.text+0x4e24): undefined reference to `EVP_CipherUpdate'
    sqlite3.c:(.text+0x4e4a): undefined reference to `EVP_CipherFinal_ex'
    sqlite3.c:(.text+0x4e5c): undefined reference to `EVP_CIPHER_CTX_free'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_set_cipher':
    sqlite3.c:(.text+0x4e9b): undefined reference to `EVP_get_cipherbyname'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_get_cipher':
    sqlite3.c:(.text+0x4ed9): undefined reference to `EVP_CIPHER_nid'
    sqlite3.c:(.text+0x4ee0): undefined reference to `OBJ_nid2sn'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_get_key_sz':
    sqlite3.c:(.text+0x4efd): undefined reference to `EVP_CIPHER_key_length'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_get_iv_sz':
    sqlite3.c:(.text+0x4f1a): undefined reference to `EVP_CIPHER_iv_length'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_get_block_sz':
    sqlite3.c:(.text+0x4f37): undefined reference to `EVP_CIPHER_block_size'
    ./.libs/libsqlcipher.a(sqlite3.o): In function `sqlcipher_openssl_get_hmac_sz':
    sqlite3.c:(.text+0x4f4a): undefined reference to `EVP_sha1'
    sqlite3.c:(.text+0x4f52): undefined reference to `EVP_MD_size'
    collect2: error: ld returned 1 exit status
    Makefile:611: set di istruzioni per l'obiettivo "sqlcipher" non riuscito
    make: *** [sqlcipher] Errore 1

```

Thanks a lot

---

<div class="post-metadata">

**Author:** ![ducarpit](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/ducarpit/32/367_2.png) [@ducarpit](https://discuss.zetetic.net/u/ducarpit)\
**Post date:** [October 17, 2017, 4:46pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/7 "2017-10-17T16:46:39Z")

</div>

Hi,  
i try in other PC and now with dynamic link i have this output. I think it’s correct:

> tclsh8.6 /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/mksqlite3h.tcl /home/christian/Scrivania/sqlcipher2/sqlcipher \>sqlite3.h  
> gcc -DSQLITE\_HAS\_CODEC -DSQLCIPHER\_CRYPTO\_OPENSSL -o mkkeywordhash /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/mkkeywordhash.c  
> ./mkkeywordhash \>keywordhash.h  
> gcc -DSQLITE\_HAS\_CODEC -DSQLCIPHER\_CRYPTO\_OPENSSL -o lemon /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/lemon.c  
> cp /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/lempar.c .  
> cp /home/christian/Scrivania/sqlcipher2/sqlcipher/src/parse.y .  
> rm -f parse.h  
> ./lemon parse.y  
> mv parse.h parse.h.temp  
> tclsh8.6 /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/addopcodes.tcl parse.h.temp \>parse.h  
> cat parse.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbe.c | tclsh8.6 /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/mkopcodeh.tcl \>opcodes.h  
> tclsh8.6 /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/mkopcodec.tcl opcodes.h \>opcodes.c  
> cp /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts5/fts5parse.y .  
> rm -f fts5parse.h  
> ./lemon fts5parse.y  
> tclsh8.6 /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts5/tool/mkfts5c.tcl  
> cp /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts5/fts5.h .  
> rm -rf tsrc  
> mkdir tsrc  
> cp -f /home/christian/Scrivania/sqlcipher2/sqlcipher/src/crypto.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/sqlcipher.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/crypto.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/crypto\_impl.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/crypto\_libtomcrypt.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/crypto\_openssl.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/crypto\_cc.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/alter.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/analyze.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/attach.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/auth.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/backup.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/bitvec.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/btmutex.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/btree.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/btree.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/btreeInt.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/build.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/callback.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/complete.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/ctime.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/date.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/dbstat.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/delete.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/expr.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/fault.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/fkey.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/func.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/global.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/hash.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/hash.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/hwtime.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/insert.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/legacy.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/loadext.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/main.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/malloc.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mem0.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mem1.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mem2.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mem3.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mem5.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/memjournal.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/msvc.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mutex.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mutex.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mutex\_noop.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mutex\_unix.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/mutex\_w32.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/notify.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/os.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/os.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/os\_common.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/os\_setup.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/os\_unix.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/os\_win.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/os\_win.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/pager.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/pager.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/parse.y /home/christian/Scrivania/sqlcipher2/sqlcipher/src/pcache.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/pcache.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/pcache1.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/pragma.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/pragma.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/prepare.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/printf.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/random.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/resolve.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/rowset.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/select.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/status.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/shell.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/sqlite.h.in /home/christian/Scrivania/sqlcipher2/sqlcipher/src/sqlite3ext.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/sqliteInt.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/sqliteLimit.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/table.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/tclsqlite.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/threads.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/tokenize.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/treeview.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/trigger.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/utf.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/update.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/util.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vacuum.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbe.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbe.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbeapi.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbeaux.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbeblob.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbemem.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbesort.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbetrace.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vdbeInt.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vtab.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/vxworks.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/wal.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/wal.h /home/christian/Scrivania/sqlcipher2/sqlcipher/src/walker.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/where.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/wherecode.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/whereexpr.c /home/christian/Scrivania/sqlcipher2/sqlcipher/src/whereInt.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts1/fts1.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts1/fts1.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts1/fts1\_hash.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts1/fts1\_hash.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts1/fts1\_porter.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts1/fts1\_tokenizer.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts1/fts1\_tokenizer1.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2\_hash.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2\_hash.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2\_icu.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2\_porter.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2\_tokenizer.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2\_tokenizer.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts2/fts2\_tokenizer1.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3Int.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_aux.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_expr.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_hash.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_hash.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_icu.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_porter.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_snippet.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_tokenizer.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_tokenizer.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_tokenizer1.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_tokenize\_vtab.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_unicode.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_unicode2.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3/fts3\_write.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/icu/sqliteicu.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/icu/icu.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rtree/rtree.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rtree/rtree.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session/sqlite3session.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session/sqlite3session.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rbu/sqlite3rbu.h /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rbu/sqlite3rbu.c /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/misc/json1.c keywordhash.h opcodes.c opcodes.h parse.c parse.h config.h sqlite3.h tsrc  
> rm tsrc/sqlite.h.in tsrc/parse.y  
> tclsh8.6 /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/vdbe-compress.tcl \<tsrc/vdbe.c \>vdbe.new  
> mv vdbe.new tsrc/vdbe.c  
> cp fts5.c fts5.h tsrc  
> touch .target\_source  
> tclsh8.6 /home/christian/Scrivania/sqlcipher2/sqlcipher/tool/mksqlite3c.tcl  
> cp tsrc/shell.c tsrc/sqlite3ext.h .  
> cp /home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session/sqlite3session.h .  
> ./libtool --mode=compile --tag=CC gcc -DSQLITE\_HAS\_CODEC -DSQLCIPHER\_CRYPTO\_OPENSSL -DSQLITE\_OS\_UNIX=1 -I. -I/home/christian/Scrivania/sqlcipher2/sqlcipher/src -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rtree -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/icu -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3 -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/async -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session -D\_HAVE\_SQLITE\_CONFIG\_H -DBUILD\_sqlite -DNDEBUG -DSQLITE\_THREADSAFE=1 -DSQLITE\_TEMP\_STORE=2 -c sqlite3.c  
> libtool: compile: gcc -DSQLITE\_HAS\_CODEC -DSQLCIPHER\_CRYPTO\_OPENSSL -DSQLITE\_OS\_UNIX=1 -I. -I/home/christian/Scrivania/sqlcipher2/sqlcipher/src -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rtree -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/icu -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3 -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/async -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session -D\_HAVE\_SQLITE\_CONFIG\_H -DBUILD\_sqlite -DNDEBUG -DSQLITE\_THREADSAFE=1 -DSQLITE\_TEMP\_STORE=2 -c sqlite3.c -fPIC -DPIC -o .libs/sqlite3.o  
> libtool: compile: gcc -DSQLITE\_HAS\_CODEC -DSQLCIPHER\_CRYPTO\_OPENSSL -DSQLITE\_OS\_UNIX=1 -I. -I/home/christian/Scrivania/sqlcipher2/sqlcipher/src -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rtree -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/icu -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3 -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/async -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session -D\_HAVE\_SQLITE\_CONFIG\_H -DBUILD\_sqlite -DNDEBUG -DSQLITE\_THREADSAFE=1 -DSQLITE\_TEMP\_STORE=2 -c sqlite3.c -o sqlite3.o \>/dev/null 2\>&1  
> ./libtool --mode=link gcc -DSQLITE\_HAS\_CODEC -DSQLCIPHER\_CRYPTO\_OPENSSL -DSQLITE\_OS\_UNIX=1 -I. -I/home/christian/Scrivania/sqlcipher2/sqlcipher/src -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rtree -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/icu -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3 -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/async -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session -D\_HAVE\_SQLITE\_CONFIG\_H -DBUILD\_sqlite -DNDEBUG -DSQLITE\_THREADSAFE=1 -lcrypto -no-undefined -o libsqlcipher.la sqlite3.lo -ldl -lcrypto -lpthread   
> -rpath “/usr/local/lib” -version-info “8:6:8”  
> libtool: link: gcc -shared -fPIC -DPIC .libs/sqlite3.o -ldl -lcrypto -lpthread -Wl,-soname -Wl,libsqlcipher.so.0 -o .libs/libsqlcipher.so.0.8.6  
> libtool: link: (cd “.libs” && rm -f “libsqlcipher.so.0” && ln -s “libsqlcipher.so.0.8.6” “libsqlcipher.so.0”)  
> libtool: link: (cd “.libs” && rm -f “libsqlcipher.so” && ln -s “libsqlcipher.so.0.8.6” “libsqlcipher.so”)  
> libtool: link: ar cru .libs/libsqlcipher.a sqlite3.o  
> libtool: link: ranlib .libs/libsqlcipher.a  
> libtool: link: ( cd “.libs” && rm -f “libsqlcipher.la” && ln -s “…/libsqlcipher.la” “libsqlcipher.la” )  
> ./libtool --mode=link gcc -DSQLITE\_HAS\_CODEC -DSQLCIPHER\_CRYPTO\_OPENSSL -DSQLITE\_OS\_UNIX=1 -I. -I/home/christian/Scrivania/sqlcipher2/sqlcipher/src -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rtree -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/icu -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3 -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/async -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session -D\_HAVE\_SQLITE\_CONFIG\_H -DBUILD\_sqlite -DNDEBUG -DSQLITE\_THREADSAFE=1 -lcrypto -DHAVE\_READLINE=0 -DHAVE\_EDITLINE=0 -DSQLITE\_ENABLE\_JSON1 -DSQLITE\_ENABLE\_FTS4 -DSQLITE\_ENABLE\_EXPLAIN\_COMMENTS -DSQLITE\_ENABLE\_UNKNOWN\_SQL\_FUNCTION   
> -o sqlcipher /home/christian/Scrivania/sqlcipher2/sqlcipher/src/shell.c libsqlcipher.la   
> -ldl -lcrypto -lpthread -rpath “/usr/local/lib”  
> libtool: link: gcc -DSQLITE\_HAS\_CODEC -DSQLCIPHER\_CRYPTO\_OPENSSL -DSQLITE\_OS\_UNIX=1 -I. -I/home/christian/Scrivania/sqlcipher2/sqlcipher/src -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/rtree -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/icu -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/fts3 -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/async -I/home/christian/Scrivania/sqlcipher2/sqlcipher/ext/session -D\_HAVE\_SQLITE\_CONFIG\_H -DBUILD\_sqlite -DNDEBUG -DSQLITE\_THREADSAFE=1 -DHAVE\_READLINE=0 -DHAVE\_EDITLINE=0 -DSQLITE\_ENABLE\_JSON1 -DSQLITE\_ENABLE\_FTS4 -DSQLITE\_ENABLE\_EXPLAIN\_COMMENTS -DSQLITE\_ENABLE\_UNKNOWN\_SQL\_FUNCTION -o .libs/sqlcipher /home/christian/Scrivania/sqlcipher2/sqlcipher/src/shell.c ./.libs/libsqlcipher.so -ldl -lcrypto -lpthread -Wl,-rpath -Wl,/usr/local/lib

---

<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:** [October 17, 2017, 8:07pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/8 "2017-10-17T20:07:17Z")

</div>

Hi @ducarpit

Is everything working for you?

---

<div class="post-metadata">

**Author:** ![ducarpit](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/ducarpit/32/367_2.png) [@ducarpit](https://discuss.zetetic.net/u/ducarpit)\
**Post date:** [October 18, 2017, 6:23am UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/9 "2017-10-18T06:23:23Z")

</div>

I don’t know exactly…i think it’s OK because there aren’t any error messages during compiling.  
I have another question: can use this library (if it’s OK) in a Java Desktop application? Because i only see .c and .h files. In Java the libraries are .jar files. Maybe i have to do other operations after compiling to obtain a jar library?  
Thanks a lot

---

<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:** [October 18, 2017, 12:56pm UTC](https://discuss.zetetic.net/t/problem-compiling-sqlcipher/2409/10 "2017-10-18T12:56:22Z")

</div>

Hello @ducarpit

You are welcome to use SQLCipher within a Java application (along with complying with the [licensing terms](https://www.zetetic.net/sqlcipher/license/), however you will be responsible for packaging the library and client library for your platform and deployment requirements. If your organization would prefer a turnkey solution for your Java desktop application, please feel free to reach out to us at [support@zetetic.net](mailto:support@zetetic.net) to discuss enterprise licensing.
