开发者

Database problem in Qt

开发者 https://www.devze.com 2023-02-09 05:16 出处:网络
I am creating an application using Qt for Symbian开发者_如何学JAVA Devices & i want to use database(sqlite)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消