Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Using SQLCipher in place of SQLite
XelaG last edited by
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)
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
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
Does anyone have an idea ?
QtDeveloper last edited by
4j1th last edited by
@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:
mingw32-make -f Makefile.Release all
mingw32-make: Entering directory 'C:/Qt/Qt5.4.2/5.4/Src/qtbase/src/plugins/sq
mingw32-make: *** No rule to make target '.moc/release/smain.moc', needed by
mingw32-make: Leaving directory 'C:/Qt/Qt5.4.2/5.4/Src/qtbase/src/plugins/sql
makefile:38: recipe for target 'release-all' failed
mingw32-make: *** [release-all] Error 2
Leonardo last edited by
Take a look at this project:
4j1th last edited by
@Leonardo I almost finished the compiling in this method, but I can't understand the error