Hi,
Everyone!

I have a strange problem with below code:
Qt Code:
  1. #include <QtSql/QSqlDatabase>
  2. #include <QMessageBox>
  3. #include <QString>
  4. #include <QApplication>
  5.  
  6.  
  7.  
  8. bool ConnectDb( const QString& hostName,
  9. const QString& dbName,
  10. const QString& usrName,
  11. const QString& pwd )
  12. {
  13.  
  14. QSqlDatabase db = QSqlDatabase::addDatabase( QString( "QMYSQL" ) );
  15.  
  16. db.setHostName( hostName );
  17. db.setDatabaseName( dbName );
  18. db.setUserName( usrName );
  19. db.setPassword( pwd );
  20.  
  21. return db.open();
  22.  
  23. }
  24.  
  25. int main( int argc, char** argv )
  26. {
  27.  
  28. QApplication app( argc, argv );
  29.  
  30. bool dbConnected = ConnectDb( "osmanthus-desktop", "MYDB",
  31. "mysql", "godfather1943@" );
  32.  
  33. if( dbConnected )
  34. {
  35. QMessageBox::information( 0, QString( "Message" ),
  36. QString( "DB Connected" ) );
  37. }
  38.  
  39. else
  40. {
  41. QMessageBox::information( 0, QString( "Message" ),
  42. QString( "DB Not Connected!" ) );
  43. }
  44.  
  45. return app.exec();
  46.  
  47. }
To copy to clipboard, switch view to plain text mode 

run this code,the error is:
Qt Code:
  1. QSqlDatabase: QMYSQL driver not loaded
To copy to clipboard, switch view to plain text mode 

my os is ubuntu 8.04
before i install qt4,run below command:
./configure -qt-sql-mysql -I /usr/include/mysql -L/usr/lib/mysql
Please give me a hand.Thank you very much!