原文地址:http://os.chinaunix.net/a2008/0514/980/000000980029.shtml
error:QtSql:Nosuchfileordirectory
I wrote a program to test that how to connect to mysql with qt4,but I got the error message as follows when I compile it:
error: QtSql: No such file or directory
There are two method to solve this problem.
1.After execute qmake -project ,edit .pro file and add QT variable definition.
QT += sql
2.edit qmake configuration file,append QT variable definition
Just find the line like this:
QT += core gui network
change it :
QT += core gui network sql