1

I am very new to Qt and as well as Qt with database. Hope I get a positive response from you end.

I am using the code written in this forum for finding the Google drive folder path.

I made a successful progress till building by solving all the errors. The build was successful, But while running I get the following error

QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: 
Error in Opening  Google Drive db 

I know I missing somewhere the configuration of SQLite with Qt. I just updated the pro file with Qt += sql

I can find the folders C:\Qt\4.8.5.x64\src\3rdparty\sqlite, C:\Qt\4.8.5.x64\src\plugins\sqldrivers\sqlite in my system.

How to make the QSqlDatabase to link to this folder? Or is there any separate installation for SQLite need to done for this or the libraries provided by the Qt itself is enough to support the database operation.

I have googled a lot, but didn't get any answers. Please let me know the steps to configure the SQLite.

Community
  • 1
  • 1
Bharathi
  • 337
  • 1
  • 5
  • 17

1 Answers1

1

Look at C:\Qt\4.8.5.x64\plugins\sqldrivers do you see there qsqlite4.dll?

If not, than you should compile Qt with parameter -plugin-sql-sqlite if it static build, and compile qsqlite plugin manually if it shared.

cd %QTDIR%\src\plugins\sqldrivers\sqlite.pro
nmake
nmake install
nmake clean
IGHOR
  • 691
  • 6
  • 22
  • [IMG]http://i59.tinypic.com/ke6639.png[/IMG] Please find the snapshot of the sqldrivers folder. The qsqlite4.dll does exist. – Bharathi May 29 '14 at 04:36
  • Nice, so give me answer, you compiled Qt statically or shared? – IGHOR May 29 '14 at 09:46
  • To build a driver plugin you need to have the appropriate client library for your Database Management System (DBMS). This is the statement I got it from Qt website... I should have a seperate installation done for SQLite rite? I thought since the Qt is providing all the libraries may be that suffice to work with it... Am i correct? – Bharathi May 29 '14 at 11:24
  • Why you didn't answer my question? Your qsqlite plugin is already builded in dll. If you are on static build, you should use Q_IMPORT_PLUGIN(qsqlite) after QApplication. – IGHOR May 29 '14 at 11:31
  • I am really not aware of static compiling or shared compiling. I am just building and running the programs using Qt Creator. – Bharathi May 30 '14 at 06:01
  • What command line you have used to compile Qt x64? If you have QtCore*.dll file in bin folder, than you are on shared build. – IGHOR May 30 '14 at 09:54
  • yes I do have the QtCore*.dll files in the bin folder. – Bharathi May 30 '14 at 10:21
  • Looks like Qt builded incorrectly. Have you compiled Qt yourself? If yes, than give me command line. If no, than you should compile it correctly or download from qt-project.org – IGHOR May 30 '14 at 14:22