Hello. I've tried to right an app with Qt 5.1.1 using sql. When I build my app I get the following error: "Cannot open include file: 'QSqlDatabase': No such file or directory". I've already put the line in the .pro file: QT += sql
Has anyone any ideas what can I do? Thanks in advance.
P.S.: The part of my application with sql code is quite simple:
//connect to database
db.setDatabaseName("sarbatori.mwb");
if ( !db.open() )
QMessageBox::critical(0,
"Error", db.
lastError().
text());
else
QSqlDatabase db(QSqlDatabase::addDatabase("QMYSQL"));
//connect to database
db.setDatabaseName("sarbatori.mwb");
if ( !db.open() )
QMessageBox::critical(0, "Error", db.lastError().text());
else
QMessageBox::information(0, "OK", "Merge!!!");
To copy to clipboard, switch view to plain text mode
Bookmarks