1
votes

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.

1
replaced tag c# with c++Felice Pollano
It's a linker error. are you sure you have linked against QDatabase library?Karl von Moor
#include <Qdatabase> & other headers related to this are not working...its showing file does not exists. SO I am using #include <Qt/qsqlquery.h>amrit_neo

1 Answers

2
votes

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

QT += sql

Then you can include QSqlQuery.