Hi everyone, I'm new on Qt, so maybe my problem is not that big, but I've searched a bit and didn't found a solution yet.
I've written an application using Qt under Linux environment, everything worked well. Then I've compiled it under xp and still everything worked well. Now I want to distribute it on computer that has not Qt installed, so I copied the exe compiled under xp, and with it I copied the dll needed (qtsql4, qtgui4, qtcore4, mingwm10) and when I run the application the "Unable to establish a database connection. This example needs SQLite support. Please read the Qt SQL driver documentation for information how to build it. Click Cancel to exit." message that is in a "connection.h" file that I show below. I really don't know how to go on...

Qt Code:
  1. #include <QTimer>
  2. #include <QtSql>
  3. #include <QMessageBox>
  4.  
  5. static bool createConnection()
  6. {
  7. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
  8. // db.setDatabaseName(":memory:");
  9. db.setDatabaseName("yorkshire_db");
  10. if (!db.open()) {
  11. QMessageBox::critical(0, qApp->tr("Cannot open database"),
  12. qApp->tr("Unable to establish a database connection.\n"
  13. "This example needs SQLite support. Please read "
  14. "the Qt SQL driver documentation for information how "
  15. "to build it.\n\n"
  16. "Click Cancel to exit."), QMessageBox::Cancel);
  17. return false;
  18. }
To copy to clipboard, switch view to plain text mode