Solved Building Qt SQLCipher driver
-
Got it imported in Qt, but get the same error when building:
C:\build-QtSQLCipher-Desktop_Qt_5_11_1_MSVC2015_64bit-Default\qsqlcipher_autogen\R265ZHLO6Z\moc_qsql_sqlite_p.cpp:80: error: C2491: 'QSQLiteDriver::staticMetaObject': definition of dllimport static data member not allowed
-
@AndersDK it seems the author has not used Windows/MSVC so far.
Maybe its easiest to contact him to solve the problem?
-
It refers to the following lines of a moc file
QT_INIT_METAOBJECT const QMetaObject QSQLiteDriver::staticMetaObject = { { &QSqlDriver::staticMetaObject, qt_meta_stringdata_QSQLiteDriver.data, qt_meta_data_QSQLiteDriver, qt_static_metacall, nullptr, nullptr} };
-
@AndersDK
Hej
That error seems to come from
__declspec(dllimport)https://stackoverflow.com/questions/3491990/c-definition-of-dllimport-static-data-member
But the odd part is that its in a moc file which is generated so
i was wondering how QSQLiteDriver is flagged (__declspec(dllexport) )
or if it need to be flagged for visual studio to be happy.
Since its only tested on mac/linux , it might need some extra
__declspec exports /handling. -
You might be right. But I don't know how to resolve it.
Is it possible to find already build drivers i can use with qt.
Maybe I should explain what I really need to solve.
I have a program that uses a local database file, created with sqlitestudio. I need to change the database file to sqlcipher in the release to protect the data, because my research tell me that I can't protect a sqlite database. So in reality what I need is a protected database that I can easily access through qt. The only specification is it need to be a local file, and a free or cheap solution. Don't need to be sqlite.
Are there an easier solution than trying to create a sqlcipher driver?
-
@AndersDK
Hi
Me neither but others users here have brilliant visual studio knowledge
so all hope is not lost yet. I think it just need a bit more tweak to compile
on windows.if a database is not really required, a local file with
https://github.com/bricke/Qt-AES
could do the trick.Most users here are in other timezones than DK so give it a day or two and
someone might know the answer. -
Thanks for the suggestion. I think I need the database to keep it organized, and easily maintainable.
I will wait and hope someone can guide me to the solution.
-
@AndersDK
Yeah, if you have multiple tables and/or relations and use
Queries to get data, a flat file will not work well. -
Hello
I couldn't get it to work. However, I found out that I could use WxSQLite3 in SQLitestudio. Googling I found a driver plugin script in the following post:
https://forum.qt.io/topic/79431/c-sqlite3-encrypted-db/5
This pluging was easy to compile directly through Qt, and no need to compile other files to make it work. The output is dlls which should just be put in the Qt sqldriver folder. This work with no problem, and I now got an encrypted database.
-