A QApplication object must be instantiated before using any of the Qt API or objects.
Once you instantiate a QApplication object certain Qt internal things are setup.
Try with:
#include <QApplication>
#include <qtsql>
int main(int argc, char *argv[])
{
return app.exec();
}
#include <QApplication>
#include <qtsql>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks