0
我试图编译下面的代码中的Qt 5.0.0:QSqlDatabase LNK2019错误
#include <QApplication>
#include <QtSql/QSql>
#include <Qtsql/QSqlDatabase>
#include <QStringList>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QStringList db = QSqlDatabase::drivers();
return a.exec();
}
,我收到此错误:
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QStringList __cdecl QSqlDatabase::drivers(void)" ([email protected]@@[email protected]@XZ) referenced in function _main
debug\test.exe:-1: error: LNK1120: 1 unresolved externals
我在.pro
添加QT += sql
。有什么问题?