Hi Everybody,

I am trying to build the QPSQL driver plugin on Windows using MinGW.
I have followed the instruction at this link:
http://www.qtcentre.org/wiki/index.p...ws_using_MinGW
but unfortunately with no success.

I have generated libpq.a file using reimp and dlltool
and I have run the following qmake command:
Qt Code:
  1. qmake -o Makefile "INCLUDEPATH+=C:\Programmi\PostgreSQL\8.4\include" "LIBS+=C:\Programmi\PostgreSQL\8.4\lib\libpq.a" psql.pro
To copy to clipboard, switch view to plain text mode 
When I run mingw32-make I get the following output:

Qt Code:
  1. C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql>mingw32-make
  2. mingw32-make -f Makefile.Debug all
  3. mingw32-make[1]: Entering directory `C:/Qt/2010.04/qt/src/plugins/sqldrivers/psq
  4. l'
  5. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
  6. DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
  7. DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
  8. nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
  9. "..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
  10. in32-g++" -o tmp\obj\debug_shared\main.o main.cpp
  11. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
  12. DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
  13. DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
  14. nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
  15. "..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
  16. in32-g++" -o tmp\obj\debug_shared\qsql_psql.o ..\..\..\sql\drivers\psql\qsql_psq
  17. l.cpp
  18. C:\Qt\2010.04\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_AS
  19. CII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT
  20. _THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"
  21. ..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I"..\..\..\..\incl
  22. ude\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -D__GNU
  23. C__ -DWIN32 ..\..\..\sql\drivers\psql\qsql_psql.h -o tmp\moc\debug_shared\moc_qs
  24. ql_psql.cpp
  25. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
  26. DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
  27. DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
  28. nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
  29. "..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
  30. in32-g++" -o tmp\obj\debug_shared\moc_qsql_psql.o tmp\moc\debug_shared\moc_qsql_
  31. psql.cpp
  32. windres -i qsqlpsqld_resource.rc -o tmp\obj\debug_shared\qsqlpsqld_resource_res.
  33. o --include-dir=.
  34. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
  35. oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\2010.04\qt\plugins\sqldrivers\li
  36. bqsqlpsqld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll tmp/obj/debug_sha
  37. red/main.o tmp/obj/debug_shared/qsql_psql.o tmp/obj/debug_shared/moc_qsql_psql.o
  38. -L"c:\Qt\2010.04\qt\lib" -L"c:\Programmi\SQLXML 4.0\bin\" -L"c:\Qt\2010.04\qt\
  39. lib" tmp\obj\debug_shared\qsqlpsqld_resource_res.o C:\Programmi\PostgreSQL\8.4\l
  40. ib\libpq.a -lQtSqld4 -lQtCored4
  41. Creating library file: c:\Qt\2010.04\qt\plugins\sqldrivers\libqsqlpsqld4.a
  42. tmp/obj/debug_shared/main.o: In function `QPSQLDriverPlugin':
  43. C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/main.cpp:58: undefined reference to
  44. `_imp___ZN16QSqlDriverPluginC2EP7QObject'
  45. C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/main.cpp:58: undefined reference to
  46. `_imp___ZN16QSqlDriverPluginC2EP7QObject'
  47. tmp/obj/debug_shared/main.o:C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/main.cp
  48. p:64: undefined reference to `_imp___ZNK7QStringeqERK13QLatin1String'
  49. tmp/obj/debug_shared/main.o:C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/main.cp
  50. p:64: undefined reference to `_imp___ZNK7QStringeqERK13QLatin1String'
  51. tmp/obj/debug_shared/main.o: In function `QString':
  52. C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
  53. c/corelib/tools/qstring.h:683: undefined reference to `_imp___ZN7QString17fromLa
  54. tin1_helperEPKci'
  55. C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
  56. c/corelib/tools/qstring.h:715: undefined reference to `_imp___Z9qt_assertPKcS0_i
  57. '
  58. tmp/obj/debug_shared/main.o: In function `~QString':
  59. C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
  60. c/corelib/tools/qstring.h:869: undefined reference to `_imp___ZN7QString4freeEPN
  61. S_4DataE'
  62. tmp/obj/debug_shared/main.o: In function `QList':
  63. C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
  64. c/corelib/tools/qlist.h:113: undefined reference to `_imp___ZN9QListData11shared
  65. _nullE'
  66.  
  67. .......
  68.  
  69.  
  70. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  71. [vtable for QPSQLDriver]+0x20): undefined reference to `QObject::eventFilter(QOb
  72. ject*, QEvent*)'
  73. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  74. [vtable for QPSQLDriver]+0x24): undefined reference to `QObject::timerEvent(QTim
  75. erEvent*)'
  76. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  77. [vtable for QPSQLDriver]+0x28): undefined reference to `QObject::childEvent(QChi
  78. ldEvent*)'
  79. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  80. [vtable for QPSQLDriver]+0x2c): undefined reference to `QObject::customEvent(QEv
  81. ent*)'
  82. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  83. [vtable for QPSQLDriver]+0x30): undefined reference to `QObject::connectNotify(c
  84. har const*)'
  85. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  86. [vtable for QPSQLDriver]+0x34): undefined reference to `QObject::disconnectNotif
  87. y(char const*)'
  88. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  89. [vtable for QPSQLDriver]+0x5c): undefined reference to `QSqlDriver::sqlStatement
  90. (QSqlDriver::StatementType, QString const&, QSqlRecord const&, bool) const'
  91. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  92. [vtable for QPSQLDriver]+0x74): undefined reference to `QSqlDriver::setOpen(bool
  93. )'
  94. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  95. [vtable for QPSQLDriver]+0x78): undefined reference to `QSqlDriver::setOpenError
  96. (bool)'
  97. tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QPSQLDriver
  98. [vtable for QPSQLDriver]+0x7c): undefined reference to `QSqlDriver::setLastError
  99. (QSqlError const&)'
  100. collect2: ld returned 1 exit status
  101. mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll] Error 1
  102. mingw32-make[1]: Leaving directory `C:/Qt/2010.04/qt/src/plugins/sqldrivers/psql
  103. '
To copy to clipboard, switch view to plain text mode 

The libqsqlpsqld4.a is generated but there is no dll.
I went through these steps several times but I cannot figure out how to solve this problem. I have also followed the instructions at this link where they seem to have the same problem:
http://www.qtcentre.org/threads/1899...Database/page2 but it didn't work.
This is my configuration: WINXP SP2 / QT 4.6.3 (qt-sdk-win-opensource-2010.04) / PostgreSQL 8.4

Does anybody know how to solve this issue? Is there any other way to get this driver?
Thank you very much for your help

Regards
Daniel