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
。有什麼問題?