Compile error QSQLCIPHER driver plugin for Qt
-
@4j1th said:
did you run qmake first ?
(/path/qmake.exe -o Makefile sqlcipher.pro)It seems to me - it whines about now having the smain.moc files
which should be created by moc.exe normally triggered
by Creator/qmake.http://doc.qt.io/qt-4.8/moc.html
You could try to open the sqlcipher.pro and "make it" and see if that produces the .moc file.
Did not read all of the step-by-step so I could be very wrong :)
-
@mrjj yes I did, the following is what I done to compile
-
Open Qt-command line
C:\Windows\System32\cmd.exe /A /Q /K C:\Qt\Qt5.4.0\5.4\mingw491_32\bin\qtenv2.bat
-
Execute the following commands:
cd C:\Qt\Qt5.4.0\5.4\Src\qtbase\src\pluins\sqldrivers\sqlcipher
qmake
mingw32-make
qmake don't produce any '.moc' file there is a file 'smain.cpp' which I created
-
-
I got a clue when running
qmake
, it don't make thesmain.moc
file in the dir .moc/release, so runqmke -d
option at the end of execution I got the message 'DEBUG 1: C:/Qt/Qt5.4.2/5.4/Src/qtbase/mkspecs/features/moc.prf:38: flow control
statement 'return', aborting block' -
Ok, so it should have made it,
Seems like it bombs out for some reason.Searching for
"flow control statement 'return', aborting block'"Gives nothing.
Maybe you get lucky at qtcentre.org
Sorry, I have no clue what it dont like :(
-
@4j1th
Hi
Very hard to say from the txt file
For some reason it wont let me go back and view the actual bug report (33795)This evening Im going to try the step-by-step in a virtual machine to see if im more lucky or get same error.
-
Hi
Got same result as you in step 6.
I used 5.4.0 as in tut.After qmake which says nothing no moc file is
generated and mingw32-make fails and no qsqlcipher.dll is produced.I then tried to create a moc by "moc.exe smain.cpp > smain.moc" and then copy that around but
either i did not hit the right directory or its not ok to create it like that. Still same error.One should think that smain.cpp that do #include "smain.moc" should find it in same folder but
maybe I should have tried with full path to the file.I have a feeling it is something really simple that will make us go facepalm once discovered.
-
@4j1th
Np, i can see the benefit of encrypted sqlite.Not sure it is a bug in qmake.
More likely something with the PRI/PRO file but it does seem like qmake just sort of bails out.Im going now for a B.day but when i get home I going to try one more time. If same result it must be
an build error. -
Ok, did it once more after some beers and it build ?!
No errors.I have shared the DLLs (debug/release) and the A files here:
https://www.dropbox.com/s/k1jm5qv7mvdyyzn/sqldrivers.zip?dl=0Cheers :)
-
@mrjj copied the dlls to plugin/sqldriver dir and build a test project but got an error
("QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7") QSqlDatabase: QSQLCIPHER driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL 7 QSqlQuery::exec: database not open QSqlQuery::exec: database not open QSqlQuery::exec: database not open Press <RETURN> to close this window...
-
Hi, I did the rest of the tut and
it did produce an encrypted db.but, then i tried to use the test .pro and main.cpp i got same
error "driver not loaded"I tried to find a fix but seems not to see the new dlls.
Not even if you make a Deploy folder with all the needed files.I think its just a path problem like here
http://stackoverflow.com/questions/14362881/qt-mysql-cant-load-plugin-driver-qlibrary-qpluginloader-successfuly-loaded-qsBut I had time to try load the DLL which works. Did not try the add path etc.
-
@4j1th
Ok, very strange.
Im out of ideas why it will not load as driver.The .a +.exe could produce a encrypted db and the dll can be loaded as DLL but
for some reason, it wont load as a sql driver.So close and yet nothing :(