PDA

View Full Version : Latest SQLite



giantdragon
17th May 2011, 15:50
I want to upgrade SQLite to the latest version, but didn't found how to build Qt plugin from SQLite source code available at their website.

wysota
17th May 2011, 16:15
I don't think you need to rebuild the plugin. Just replace the older SQLite library with the new one when deploying your app.

giantdragon
17th May 2011, 18:55
Library from SQLite website don't work with Qt.

wysota
17th May 2011, 20:28
Library from SQLite website don't work with Qt.

Really? Why not?

giantdragon
17th May 2011, 21:59
Problem solved!

wysota
17th May 2011, 23:08
No, they didn't forget to change the include. And if you want to use a different sqlite version than the one that comes with Qt then you need to tell Qt to use the system sqlite library instead of using the sources of sqlite directly (or you can just replace the source files and rebuild the driver). Consult "configure -help" for more info.

giantdragon
17th May 2011, 23:51
Fortunately I have successfully compiled latest SQLite version. It seems works!!!:o

1. Download latest SQLite sources, unpack them, copy to "C:\QtSDK\QtSources\4.7.3\src\3rdparty\sqlite"
2. Open file "C:\QtSDK\QtSources\4.7.3\src\sql\drivers\sqlite\qs ql_sqlite.h" Replace "#include <QtSql/private/qsqlcachedresult_p.h>" to "#include <C:/QtSDK/QtSources/4.7.3/src/sql/kernel/qsqlcachedresult_p.h>"
3. cd "C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\sq lite"
4. qmake "INCLUDEPATH+=C:\QtSDK\QtSources\4.7.3\src\plugins\ sqldrivers\" "LIBS+=C:\QtSDK\QtSources\4.7.3\src\plugins\sqldriv ers\"
5. mingw32-make release

Spent whole day solving this problem. I think Nokia must write tutorial how to do this and update include path.

ChrisW67
18th May 2011, 00:56
I think Nokia must write tutorial how to do this and update include path.
There's a perfectly good option to build the Qt libraries using a system (external) Sqlite, rather than the bundled Sqlite. It is documented in the configure options referred to by the existing install docs (http://doc.qt.nokia.com/4.7/install-win.html) (See Step 4), and also pointed out by Wysota above. Had you used that option this exercise would have been trivial.


configure --help
...
-system-sqlite ..... Use sqlite from the operating system.
...
-I <string> ........ Add an explicit include path.
-L <string> ........ Add an explicit library path.
...


Download, unpack, build, and install the SQlite library.
Unpack the Qt source or clean the configuration of an existing copy
Configure the Qt source with the "-system-sqlite" option. You will probably also need the -I and -L options.
Build Qt

After this updating the version of Sqlite used is as simple as replacing the shared library.