tags:

views:

39

answers:

1

when I compile the codes which has database connection, there's an error like,

QtSql: No such file or directory

I suppose that the sql library must be in Qt, but I dont have any idea why an error occured ? what to do for enable the database's libraries? Can you help me please, thanks

A: 

From QtSql documentation,

In your .pro file you have to add,

QT += sql

AFAIK there is no separate library to be included for Sql modulue. It's enough if you add the above line to your .pro file.

Since you are not aware of adding libraries,

From qmake documentation, libraries can be added by using LIBS keyword.

An example from the same documentation itself..

unix:LIBS += -lmath -L/usr/local/lib
win32:LIBS += c:\mylibs\math.lib

Hope it helps.

liaK