I am trying to use SQLCipher within my QT C++ project. I am running a windows machine and I have used steps explained in here (until end of step 5) to generate my sqlite3.h
, sqlite3.c
, sqlcipher.exe
and sqlite3.dll
. Hopefully, now I have an executable that works fine but I am trying to make use of SQLCipher within my QT project. I want to add sqlite3.h
and sqlite3.dll
to my project and use its functions to work with databases. I have copied sqlite3.h
and sqlite3.dll
from sqlcipher-master
into my project. My .pro
file looks like this:
HEADERS +=\
sqlcipher/sqlite3.h \
myOtherHeaderFiles.\
QMAKE_CXXFLAGS += -DSQLITE_OS_WIN=1 -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -ldl -lpthread
LIBS+="path\to\project\sqlite3.dll"
When I try to build my project no compiling error occurs but when I try to run it I get:
11:55:15: Starting path\to\project\build-project-Desktop_Qt_5_14_1_MinGW_32_bit-Debug\project.exe ...
11:55:15: The program has unexpectedly finished.
11:55:15: The process was ended forcefully.
11:55:15: path\to\project\build-project-Desktop_Qt_5_14_1_MinGW_32_bit-Debug\project\build-project-Desktop_Qt_5_14_1_MinGW_32_bit-Debug\project.exe crashed.
Do I miss something important? Do I copy the wrong files or is there anything more to add to my project before building it? if you have had the experience of using SQLCipher in a QT+mingw project please leave a comment or guide me through.