PDA

View Full Version : Building QSQLITE driver with AES-256



guiQt
17th October 2010, 22:43
Hi, I'm trying to build QSQLITE driver with AES-256 encryption support
(Qt 4.7, Ubuntu 10.10, sqlcipher v.1.1.8 / v.1.1.7).
I followed instructions (http://www.qtcentre.org/wiki/index.php?title=Building_QSQLITE_driver_with_AES-256_encryption_support_%28Linux%29) by Lykurg step by step, but in "Building SQLCipher" when I execute make, the result is a long list of sqlite3.c:#:errors I reported in output.log.
I double checked each previous step. Any idea what went wrong?
Thank you.

ChrisW67
18th October 2010, 00:39
It looks like the build instructions for SQLCipher have changed slightly. Try either:


# Static link to OpenSSL
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="/path/to/libcrypto.a"
make
OR
# Dynamic link to OpenSSL
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
make
You might need to add the --prefix path also. Both from http://sqlcipher.net/documentation

Lykurg
18th October 2010, 07:15
I'll have a look on that later on this day. Do you compile static, because I only have tested dynamic linking...

ChrisW67
18th October 2010, 09:35
Those two options are from the SQLCipher site for linking the OpenSSL library only. I wouldn't think this has any effect on the dynamic/static state of Qt itself. I am likely to use dynamic linking exclusively when I get around to using this in anger.

guiQt
18th October 2010, 09:54
Dynamic linking worked for me!
Thanks.

Lykurg
18th October 2010, 14:00
Hm, the mentioned flags are set in the wiki description. Only I didn't use --enable-tempstore=yes, but I doubt this affect the building of sqlite. As a closer look on the posted error log, it seems that also SQLITE_HAS_CODEC wasn't set. Are you sure you have altered the pro file? But anyway I try it on my sandbox...

ChrisW67
18th October 2010, 22:20
The SQLITE_HAS_CODEC define is present in the PRO file in the wiki but that is used for compiling the Qt half of the driver which is linked to the already built SQLCipher library. The problem here is building the SQLCipher library, which is not Qt related.

The options are not present in the section titled Building SQLCipher (http://www.qtcentre.org/wiki/index.php?title=Building_QSQLITE_driver_with_AES-256_encryption_support_(Linux)&section=8#Building_SQLCipher). On my Gentoo machine it would not compile and link without:


./configure --prefix=/usr/local CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"