[問題] 如何在QT中使用資料庫?

看板C_and_CPP (C/C++)作者 (夏天的微笑)時間14年前 (2012/01/05 21:28), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Qt Creator 2.4.0 Qt 4.7.4 Windows XP SP3 問題(Question): 按照document裡的寫法 (http://doc.qt.nokia.com/4.7/qsqldatabase.html) #include <QSqlDatabase> 這行會出現錯誤訊息 error: QSqlDatabase: No such file or directory 按照google找到的寫法 #include <QtSql> 一樣會出現No such file or directory的訊息 假如#include <QtSql/QSqlDatabase> 下面這行 QStringList drivers = QSqlDatabase::drivers(); 會出現錯訊訊息 error: undefined reference to `_imp___ZN12QSqlDatabase7driversEv' 請問問題是出在哪裡呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.219.121

01/05 21:45, , 1F
project file 有加 SQL ?
01/05 21:45, 1F

01/05 22:04, , 2F
喔喔 可以了 感謝!
01/05 22:04, 2F
文章代碼(AID): #1F1QM999 (C_and_CPP)
文章代碼(AID): #1F1QM999 (C_and_CPP)