1

I am creating an application using Qt for Symbian 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.

3
  • replaced tag c# with c++ Commented Feb 5, 2011 at 7:40
  • 2
    It's a linker error. are you sure you have linked against QDatabase library? Commented Feb 5, 2011 at 7:46
  • #include <Qdatabase> & other headers related to this are not working...its showing file does not exists. SO I am using #include <Qt/qsqlquery.h> Commented Feb 5, 2011 at 8:44

1 Answer 1

2

I think you forgot to add the SQL support in your .pro file

QT += sql

Then you can include QSqlQuery.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.