I m using Qt 4.4.3 and I have installed SQLite Maestro (windows OS).

Now I want to connect to DB ,


I have started with some code but getting errroe

Header file is
Qt Code:
  1. #ifndef DB_TRANS_H
  2. #define DB_TRANS_H
  3.  
  4.  
  5.  
  6.  
  7. class DB_TRANS
  8. {
  9. public:
  10. DB_TRANS();
  11. }
  12.  
  13.  
  14. #endif
To copy to clipboard, switch view to plain text mode 

and cpp file is

Qt Code:
  1. #include "DB_TRANS.h"
  2. #include <QMessageBox>
  3. #include <QSqlDatabase>
  4. #include <QSqlQuery>
  5. #include <QSqlError>
  6.  
  7.  
  8.  
  9. DB_TRANS::DB_TRANS()
  10. {
  11. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
  12. db.setHostName("localhost");
  13. db.setDatabaseName("SE01_DB");
  14. // db.setUserName("mojito");
  15. db.setPassword("SE01");
  16. bool ok = db.open();
  17.  
  18. if(!ok){
  19. QMessageBox::critical( this, "SE01_DB Database Error",
  20. "Could not connect to the database!\n"
  21. "\n"
  22. "Reported error:\n"
  23. +db.lastError().driverText()+"\n"
  24. +db.lastError().databaseText()+"\n"
  25. +db.databaseName()+"\n");
  26. }
  27. }
To copy to clipboard, switch view to plain text mode 


these 2 files I have included in my .PRO file.
also included below line in PRO file
Qt Code:
  1. QT += sql
To copy to clipboard, switch view to plain text mode 
But when I compile the program I get below errors

Qt Code:
  1. In file included from C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stddef.h:6,
  2. from ../../../include/QtCore/../../src/corelib/global/qglobal.h:41,
  3. from ../../../include/QtCore/qglobal.h:1,
  4. from ../../../include/QtCore/../../src/corelib/global/qnamespace.h:41,
  5. from ../../../include/QtCore/qnamespace.h:1,
  6. from ../../../include/QtCore/../../src/corelib/kernel/qobjectdefs.h:41,
  7. from ../../../include/QtCore/qobjectdefs.h:1,
  8. from ../../../include/QtGui/../../src/gui/kernel/qwindowdefs.h:41,
  9. from ../../../include/QtGui/qwindowdefs.h:1,
  10. from ../../../include/QtGui/../../src/gui/kernel/qwidget.h:41,
  11. from ../../../include/QtGui/qwidget.h:1,
  12. from ../../../include/QtGui/../../src/gui/dialogs/qdialog.h:41,
  13. from ../../../include/QtGui/qdialog.h:1,
  14. from ../../../include/QtGui/../../src/gui/dialogs/qmessagebox.h:41,
  15. from ../../../include/QtGui/qmessagebox.h:1,
  16. from ../../../include/QtGui/QMessageBox:1,
  17. from DB_TRANS.cpp:2:
  18. C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/include/stddef.h:151: error: extraneous `int' ignored
  19. In file included from C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/char_traits.h:46,
  20. from C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/string:47,
  21. from ../../../include/QtCore/../../src/corelib/tools/qstring.h:56,
  22. from ../../../include/QtCore/qstring.h:1,
  23. from ../../../include/QtCore/../../src/corelib/kernel/qobject.h:44,
  24. from ../../../include/QtCore/qobject.h:1,
  25. from ../../../include/QtGui/../../src/gui/kernel/qwidget.h:42,
  26. from ../../../include/QtGui/qwidget.h:1,
  27. from ../../../include/QtGui/../../src/gui/dialogs/qdialog.h:41,
  28. from ../../../include/QtGui/qdialog.h:1,
  29. from ../../../include/QtGui/../../src/gui/dialogs/qmessagebox.h:41,
  30. from ../../../include/QtGui/qmessagebox.h:1,
  31. from ../../../include/QtGui/QMessageBox:1,
  32. from DB_TRANS.cpp:2:
  33. C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algobase.h: In static member function `static _Tp* std::__copy_backward_dispatch<_Tp*, _Tp*, __true_type>::copy(const _Tp*, const _Tp*, _Tp*)':
  34. C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algobase.h:407: error: no match for 'operator*' in 'sizeof (_Tp) * _Num'
  35. In file included from C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/string:48,
  36. from ../../../include/QtCore/../../src/corelib/tools/qstring.h:56,
  37. from ../../../include/QtCore/qstring.h:1,
  38. from ../../../include/QtCore/../../src/corelib/kernel/qobject.h:44,
  39. from ../../../include/QtCore/qobject.h:1,
  40. from ../../../include/QtGui/../../src/gui/kernel/qwidget.h:42,
  41. from ../../../include/QtGui/qwidget.h:1,
  42. from ../../../include/QtGui/../../src/gui/dialogs/qdialog.h:41,
  43. from ../../../include/QtGui/qdialog.h:1,
  44. from ../../../include/QtGui/../../src/gui/dialogs/qmessagebox.h:41,
  45. from ../../../include/QtGui/qmessagebox.h:1,
  46. from ../../../include/QtGui/QMessageBox:1,
  47.  
  48.  
  49. and many more errors like this
To copy to clipboard, switch view to plain text mode 

I m not able to diagnose the problem,

Tell me the steps to connect to sQLite database