SQLCiper for Qt cross platform

483 views
Skip to first unread message

AbiusX

unread,
Sep 9, 2010, 4:27:18 AM9/9/10
to SQLCipher Users
Hi
I'm developing a software using SQLite in Qt. The software is platform
independent (even runs on the cell phones).
I'm having problems migrate to SQLCipher, I dunno how to link it
statically or dynamically o my Qt project, Specially on different
platforms.

My main platform is Mac OS X 10.6

Specific instructions would be highly appreciated,
Regards
AbiusX

Stephen Lombardo

unread,
Sep 12, 2010, 10:46:08 PM9/12/10
to sqlc...@googlegroups.com
Hi AbiusX,

There are a few other people on this list that have used QT quite extensively. One developer even wrote up a tutorial which you can find here:

http://www.wiki.crossplatform.ru/index.php/%D0%9F%D1%80%D0%B8%D0%B2%D1%8F%D0%B7%D0%BA%D0%B0_SQLCipher_%D0%BA_Qt#.D0.9E.D0.B1.D1.81.D1.83.D0.B6.D0.B4.D0.B5.D0.BD.D0.B8.D0.B5

The tutorial is in Russian, but you can use google translate on it. 

There is also an excellent discussion on the subject on this mailing list:

http://groups.google.com/group/sqlcipher/browse_thread/thread/fd8b2763e7ae1291/ade4de0905582ca1

One user,  Mathijs van Westendorp, in that disussion recommends:

replace sqlite3.c & sqlite3.h 
in qt\src\3rdparty\sqlite with the ones from sqlcipher then adding 
SQLITE_HAS_CODEC & SQLITE_OS_WIN=1 to the project parameters and including 
openssl include directory & libraries (dll's). 

This latter approach is nice, as it should automatically build to the right architecture based on your compile settings. Incidentally, this is the same approach we user for SQLCIpher on the iOS platforms where various processor architectures are required.

Cheers,
Stephen

Stuk

unread,
Sep 13, 2010, 10:32:27 AM9/13/10
to SQLCipher Users
I use this:

Build Sqlcipher

Instal MSYS in
Instal ActivePearl
Instal ActiveTlcTk
Instal MinGW
Instal OpenSSL for windows (in my case)
download Sqlcipher put in c:\sqlcipher

Open MSYS and go to c:\sqlcipher
./configure --prefix=/c/Qt/2010.04/qt/src/plugins/sqldrivers/sqlcipher
--disable-tcl --disable-amalgamation CFLAGS="-DSQLITE_HAS_CODEC -I../
OpenSSL2/include /c/OpenSSL/bin/libeay32.dll"

make
make dll
make install


Build Plugins For Qt
Put sqlite3.dll in /src/plugins/sqldrivers/sqlcipher
Open qt terminal (check if make doing...if wrong rename minGW32-
make.exe in make.exe)
Go to /src/plugins/sqldrivers/sqlite/

qmake "INCLUDEPATH+=C:\Qt\2010.04\qt\src\plugins\sqldrivers\sqlcipher
\include" "LIBS+=C:\Qt\2010.04\qt\src\plugins\sqldrivers\sqlcipher
\sqlite3.dll" sqlite.pro
make
make install

Put in your final executable sqlite3.dll + libeay32.dll

The path for QT sqlcipher pluging SSL is an example...you have to
correct that!
Bye.

Stephen Lombardo

unread,
Sep 13, 2010, 10:13:24 PM9/13/10
to sqlc...@googlegroups.com
AbiusX,

Here is another tutorial that was just posted on the subject of building SQLCipher for QT:


Cheers,
Stephen
Reply all
Reply to author
Forward
0 new messages