Database problem in Qt
I am creating an application using Qt for Symbian开发者_如何学JAVA Devices & i want to use database(sqlite) but it is craeting this error. How to remove this?
Code:
QSqlQuery query;
query.prepare("INSERT INTO glucose(value, date, time, duration, note)""VALUES(:value, :date, :time, :duration, :note)");
query.bindValue(":value",edit_glucose->text());
query.bindValue(":date",datetime->date());
query.bindValue(":time",datetime->time());
query.bindValue(":duration","a");
query.bindValue(":note",edit_note->toPlainText());
query.exec();
adddata.obj:: error: unresolved external symbol "__declspec(dllimport) public: _thiscall QSqlQuery::~QSqlQuery(void)" (_imp_??1QSqlQuery@@QAE@XZ) referenced in function "private: void __thiscall AddData::save(void)" (?save@AddData@@AAEXXZ)
Thank you.
I think you forgot to add the SQL support in your .pro file
QT += sql
Then you can include QSqlQuery.
精彩评论