Compile driver Postgress 9.2 Qt5.0.1 MinGW



  • these are the steps I took:
    reimp libpq.lib

    dlltool --input-def libpq.def --output-lib libpq.a --dllname libpq.dll

    configure.exe -debug-and-release -platform win32-g++ -qt-sql-psql -l psql -I C:/PostgreSQL/9.2/include -L C:/PostgreSQL/9.2/lib

    qmake -o Makefile "INCLUDEPATH+=C:/PostgreSQL/9.2/include" "LIBS+=C:/PostgreSQL/9.2/lib/libpq.a" psql.pro

    this is the error.

    Setting up environment for Qt usage...

    C:\Qt\Qt5.0.1\5.0.1\mingw47_32>cd C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sql
    drivers\psql

    C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\psql>qmake -o Makefile "IN
    CLUDEPATH+=C:/PostgreSQL/9.2/include" "LIBS+=C:/PostgreSQL/9.2/lib/libpq.a" psql
    .pro

    C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\psql>mingw32-make
    mingw32-make -f Makefile.Release all
    mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.1/5.0.1/Src/qtbase/src/plugins/
    sqldrivers/psql'
    C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\moc.exe -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_
    NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQ
    T_CORE_LIB -I. -I"C:\PostgreSQL\9.2\include" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\i
    nclude" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1
    mingw47_32\include\QtSql\5.0.1" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql
    5.0.1\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I".moc\release_s
    hared" -I"........\mkspecs\win32-g++" -D__GNUC__ -DWIN32 main.cpp -o .moc\rel
    ease_shared\main.moc
    g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -fno-exceptions -frtti -W
    all -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCE
    PTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"C:\PostgreSQL
    \9.2\include" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"C:\Qt\Qt5.0.1\5.0.1
    mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1"
    -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1\QtSql" -I"C:\Qt\Qt5.0.1\5
    .0.1\mingw47_32\include\QtCore" -I".moc\release_shared" -I"........\mkspecs\w
    in32-g++" -o .obj\release_shared\main.o main.cpp
    In file included from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/i686-w64-mingw32/bits/gthr-default.h:41:0,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/i686-w64-mingw32/bits/gthr.h:150,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/ext/atomicity.h:34,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/bits/basic_string.h:41,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/string:54,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/random:41,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/bits/stl_algo.h:67,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/algorithm:63,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qglobal.h:80
    ,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qnamespace.h
    :45,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qobjectdefs.
    h:45,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qobject.h:47
    ,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qplugin.h:45
    ,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql/qsqldriverplu
    gin.h:45,
    from main.cpp:42:
    C:\PostgreSQL\9.2\include/pthread.h:307:8: error: redefinition of 'struct timesp
    ec'
    In file included from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/../../../../i686-w64-mingw32/include/time.h:277:0,
    from C:\PostgreSQL\9.2\include/pthread.h:218,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/i686-w64-mingw32/bits/gthr-default.h:41,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/i686-w64-mingw32/bits/gthr.h:150,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/ext/atomicity.h:34,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/bits/basic_string.h:41,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/string:54,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/random:41,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/bits/stl_algo.h:67,
    from c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/algorithm:63,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qglobal.h:80
    ,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qnamespace.h
    :45,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qobjectdefs.
    h:45,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qobject.h:47
    ,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include/QtCore/qplugin.h:45
    ,
    from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql/qsqldriverplu
    gin.h:45,
    from main.cpp:42:
    c:\qt\qt5.0.1\tools\mingw\bin../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686
    -w64-mingw32/include/sys/timeb.h:90:8: error: previous definition of 'struct tim
    espec'
    Makefile.Release:391: recipe for target '.obj/release_shared/main.o' failed
    mingw32-make[1]: *** [.obj/release_shared/main.o] Error 1
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.1/5.0.1/Src/qtbase/src/plugins/s
    qldrivers/psql'
    makefile:38: recipe for target 'release-all' failed
    mingw32-make: *** [release-all] Error 2

    C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\psql>


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.