DanMcCoder
28th June 2010, 06:36
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.php?title=Building_the_QPSQL_plugin_on_Windo 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:
qmake -o Makefile "INCLUDEPATH+=C:\Programmi\PostgreSQL\8.4\include" "LIBS+=C:\Programmi\PostgreSQL\8.4\lib\libpq.a" psql.pro
When I run mingw32-make I get the following output:
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql>mingw32-make
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/2010.04/qt/src/plugins/sqldrivers/psq
l'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
in32-g++" -o tmp\obj\debug_shared\main.o main.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
in32-g++" -o tmp\obj\debug_shared\qsql_psql.o ..\..\..\sql\drivers\psql\qsql_psq
l.cpp
C:\Qt\2010.04\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_AS
CII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT
_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"
..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I"..\..\..\..\incl
ude\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -D__GNU
C__ -DWIN32 ..\..\..\sql\drivers\psql\qsql_psql.h -o tmp\moc\debug_shared\moc_qs
ql_psql.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
in32-g++" -o tmp\obj\debug_shared\moc_qsql_psql.o tmp\moc\debug_shared\moc_qsql_
psql.cpp
windres -i qsqlpsqld_resource.rc -o tmp\obj\debug_shared\qsqlpsqld_resource_res.
o --include-dir=.
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\2010.04\qt\plugins\sqldrivers\li
bqsqlpsqld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll tmp/obj/debug_sha
red/main.o tmp/obj/debug_shared/qsql_psql.o tmp/obj/debug_shared/moc_qsql_psql.o
-L"c:\Qt\2010.04\qt\lib" -L"c:\Programmi\SQLXML 4.0\bin\" -L"c:\Qt\2010.04\qt\
lib" tmp\obj\debug_shared\qsqlpsqld_resource_res.o C:\Programmi\PostgreSQL\8.4\l
ib\libpq.a -lQtSqld4 -lQtCored4
Creating library file: c:\Qt\2010.04\qt\plugins\sqldrivers\libqsqlpsqld4. a
tmp/obj/debug_shared/main.o: In function `QPSQLDriverPlugin':
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/main.cpp:58: undefined reference to
`_imp___ZN16QSqlDriverPluginC2EP7QObject'
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/main.cpp:58: undefined reference to
`_imp___ZN16QSqlDriverPluginC2EP7QObject'
tmp/obj/debug_shared/main.o:C:\Qt\2010.04\qt\src\plugins\sqldrivers\psq l/main.cp
p:64: undefined reference to `_imp___ZNK7QStringeqERK13QLatin1String'
tmp/obj/debug_shared/main.o:C:\Qt\2010.04\qt\src\plugins\sqldrivers\psq l/main.cp
p:64: undefined reference to `_imp___ZNK7QStringeqERK13QLatin1String'
tmp/obj/debug_shared/main.o: In function `QString':
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
c/corelib/tools/qstring.h:683: undefined reference to `_imp___ZN7QString17fromLa
tin1_helperEPKci'
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
c/corelib/tools/qstring.h:715: undefined reference to `_imp___Z9qt_assertPKcS0_i
'
tmp/obj/debug_shared/main.o: In function `~QString':
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
c/corelib/tools/qstring.h:869: undefined reference to `_imp___ZN7QString4freeEPN
S_4DataE'
tmp/obj/debug_shared/main.o: In function `QList':
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
c/corelib/tools/qlist.h:113: undefined reference to `_imp___ZN9QListData11shared
_nullE'
.......
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x20): undefined reference to `QObject::eventFilter(QOb
ject*, QEvent*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x24): undefined reference to `QObject::timerEvent(QTim
erEvent*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x28): undefined reference to `QObject::childEvent(QChi
ldEvent*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x2c): undefined reference to `QObject::customEvent(QEv
ent*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x30): undefined reference to `QObject::connectNotify(c
har const*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x34): undefined reference to `QObject::disconnectNotif
y(char const*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x5c): undefined reference to `QSqlDriver::sqlStatement
(QSqlDriver::StatementType, QString const&, QSqlRecord const&, bool) const'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x74): undefined reference to `QSqlDriver::setOpen(bool
)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x78): undefined reference to `QSqlDriver::setOpenError
(bool)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x7c): undefined reference to `QSqlDriver::setLastError
(QSqlError const&)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/2010.04/qt/src/plugins/sqldrivers/psql
'
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/18993-Regading-Driver-to-connect-Postgresql-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
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.php?title=Building_the_QPSQL_plugin_on_Windo 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:
qmake -o Makefile "INCLUDEPATH+=C:\Programmi\PostgreSQL\8.4\include" "LIBS+=C:\Programmi\PostgreSQL\8.4\lib\libpq.a" psql.pro
When I run mingw32-make I get the following output:
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql>mingw32-make
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/2010.04/qt/src/plugins/sqldrivers/psq
l'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
in32-g++" -o tmp\obj\debug_shared\main.o main.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
in32-g++" -o tmp\obj\debug_shared\qsql_psql.o ..\..\..\sql\drivers\psql\qsql_psq
l.cpp
C:\Qt\2010.04\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_AS
CII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT
_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"
..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I"..\..\..\..\incl
ude\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -D__GNU
C__ -DWIN32 ..\..\..\sql\drivers\psql\qsql_psql.h -o tmp\moc\debug_shared\moc_qs
ql_psql.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtSql" -I"..\..\..\..\include" -I"c:\Programmi\PostgreSQL\8.4\include" -I
"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\w
in32-g++" -o tmp\obj\debug_shared\moc_qsql_psql.o tmp\moc\debug_shared\moc_qsql_
psql.cpp
windres -i qsqlpsqld_resource.rc -o tmp\obj\debug_shared\qsqlpsqld_resource_res.
o --include-dir=.
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\2010.04\qt\plugins\sqldrivers\li
bqsqlpsqld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll tmp/obj/debug_sha
red/main.o tmp/obj/debug_shared/qsql_psql.o tmp/obj/debug_shared/moc_qsql_psql.o
-L"c:\Qt\2010.04\qt\lib" -L"c:\Programmi\SQLXML 4.0\bin\" -L"c:\Qt\2010.04\qt\
lib" tmp\obj\debug_shared\qsqlpsqld_resource_res.o C:\Programmi\PostgreSQL\8.4\l
ib\libpq.a -lQtSqld4 -lQtCored4
Creating library file: c:\Qt\2010.04\qt\plugins\sqldrivers\libqsqlpsqld4. a
tmp/obj/debug_shared/main.o: In function `QPSQLDriverPlugin':
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/main.cpp:58: undefined reference to
`_imp___ZN16QSqlDriverPluginC2EP7QObject'
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/main.cpp:58: undefined reference to
`_imp___ZN16QSqlDriverPluginC2EP7QObject'
tmp/obj/debug_shared/main.o:C:\Qt\2010.04\qt\src\plugins\sqldrivers\psq l/main.cp
p:64: undefined reference to `_imp___ZNK7QStringeqERK13QLatin1String'
tmp/obj/debug_shared/main.o:C:\Qt\2010.04\qt\src\plugins\sqldrivers\psq l/main.cp
p:64: undefined reference to `_imp___ZNK7QStringeqERK13QLatin1String'
tmp/obj/debug_shared/main.o: In function `QString':
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
c/corelib/tools/qstring.h:683: undefined reference to `_imp___ZN7QString17fromLa
tin1_helperEPKci'
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
c/corelib/tools/qstring.h:715: undefined reference to `_imp___Z9qt_assertPKcS0_i
'
tmp/obj/debug_shared/main.o: In function `~QString':
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
c/corelib/tools/qstring.h:869: undefined reference to `_imp___ZN7QString4freeEPN
S_4DataE'
tmp/obj/debug_shared/main.o: In function `QList':
C:\Qt\2010.04\qt\src\plugins\sqldrivers\psql/../../../../include/QtCore/../../sr
c/corelib/tools/qlist.h:113: undefined reference to `_imp___ZN9QListData11shared
_nullE'
.......
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x20): undefined reference to `QObject::eventFilter(QOb
ject*, QEvent*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x24): undefined reference to `QObject::timerEvent(QTim
erEvent*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x28): undefined reference to `QObject::childEvent(QChi
ldEvent*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x2c): undefined reference to `QObject::customEvent(QEv
ent*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x30): undefined reference to `QObject::connectNotify(c
har const*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x34): undefined reference to `QObject::disconnectNotif
y(char const*)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x5c): undefined reference to `QSqlDriver::sqlStatement
(QSqlDriver::StatementType, QString const&, QSqlRecord const&, bool) const'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x74): undefined reference to `QSqlDriver::setOpen(bool
)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x78): undefined reference to `QSqlDriver::setOpenError
(bool)'
tmp/obj/debug_shared/moc_qsql_psql.o:moc_qsql_psql.cpp:(.rdata$_ZTV11QP SQLDriver
[vtable for QPSQLDriver]+0x7c): undefined reference to `QSqlDriver::setLastError
(QSqlError const&)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/2010.04/qt/src/plugins/sqldrivers/psql
'
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/18993-Regading-Driver-to-connect-Postgresql-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