Using SQLCipher in place of SQLite
-
Hello,
I would like to use encrypted SQLite databases with Qt.
The company I work for, has been using SQLCipher with C++ Builder XE3 for almost two years (they bought a license). In this context it's pretty easy cause there's only a sqlite3.dll file to load.We're switching from C++ Builder to Qt.
With Qt I can access SQLite database with the sqlite3 driver compiled with Qt. I tried it, it works and it's pretty easy to use.According to the documentation it is possible to link with my own sqlite library ("How to Build the QSQLITE Plugin":http://qt-project.org/doc/qt-5.0/qtsql/sql-driver.html#qsqlite).
When we bought a SQLCipher licence we got a zip file which contains the following file:
- sqlite3.c (SQLite Amalgamation file)
- sqlite3.h
- libeay32.lib
- sqlite3.dll
- sqlite3.lib
I tried to recompile the SQLite driver for Qt but it failed.
Here the step I followed:- Configure with qmake
@qmake "INCLUDEPATH+=C:/AEProjects/SDKs/SQLCipher/binaries/" "LIBS+=-LC:/AEProjects/SDKs/SQLCipher/binaries/win32/lib -lsqlite3"@ - build it
@mingw32-make@
But it failed with the error : "ld.exe: cannot find -lsqlite3"
Do you think it's due to the sqlite3.lib file which might be sqlite3.a ?
In this case I will have to recompile sqlcipher with mingw-32.I've seen those articles but I wanted to only link a specifc lib without recompiling SQLCipher.
"Building QSQLITE driver with AES-256 encryption support":http://www.qtcentre.org/wiki/index.php?title=Building_QSQLITE_driver_with_AES-256_encryption_support"SQLCipher for Qt":http://www.wiki.crossplatform.ru/index.php/Привязка_SQLCipher_к_Qt#.D0.9E.D0.B1.D1.81.D1.83.D0.B6.D0.B4.D0.B5.D0.BD.D0.B8.D0.B5
Does anyone have an idea ?
-
-
Hi @QtDeveloper
Are you the author of that post ? If yes then I would suggest you to add it to http://wiki.qt.io.
It is a common place for such articles. -
@QtDeveloper I tried that like, On step-6 section 'Compile the QSQLCIPHER-driver-plugin for Qt', executing mingw32-make I got an error message.
I can't understand the error:
C:\Qt\Qt5.4.2\5.4\Src\qtbase\src\plugins\sqldrivers\sqlcipher>mingw32-make
mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory 'C:/Qt/Qt5.4.2/5.4/Src/qtbase/src/plugins/sq
ldrivers/sqlcipher'mingw32-make[1]: *** No rule to make target '.moc/release/smain.moc', needed by
'.obj/release/smain.o'. Stop.mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.4.2/5.4/Src/qtbase/src/plugins/sql
drivers/sqlcipher'makefile:38: recipe for target 'release-all' failed
mingw32-make: *** [release-all] Error 2
-
Take a look at this project:
-
@Leonardo I almost finished the compiling in this method, but I can't understand the error