Results 1 to 2 of 2

Thread: Compile driver Postgress 9.2 Qt5.0.1 MinGW

  1. #1
    Join Date
    Mar 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Compile driver Postgress 9.2 Qt5.0.1 MinGW

    hi;
    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\sqldriv ers\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\sqldriv ers\psql>mingw32-make
    mingw32-make -f Makefile.Release all
    mingw32-make1: 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\QtS ql” -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\QtS ql\
    5.0.1\QtSql” -I“C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtC ore” -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\QtS ql\5.0.1” -I“C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtS ql\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-make1: *** [.obj/release_shared/main.o] Error 1
    mingw32-make1: 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\sqldriv ers\psql>

    error Line: C:\PostgreSQL\9.2\include/pthread.h:307:8: error: redefinition of 'struct timespec'

  2. #2
    Join Date
    May 2013
    Posts
    1
    Qt products
    Qt4 Qt5 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Cool Re: Compile driver Postgress 9.2 Qt5.0.1 MinGW

    1- go to potgresql/include
    2-temporary rename pthread.h to another name
    3- compile works ok

Similar Threads

  1. not able to compile sql driver mysql
    By sujan.dasmahapatra in forum Newbie
    Replies: 2
    Last Post: 14th July 2011, 19:44
  2. Compile error in Qt 4.7.3 with mingw
    By zither in forum Installation and Deployment
    Replies: 0
    Last Post: 4th June 2011, 20:13
  3. OCI Driver and MinGW
    By mcosta in forum Installation and Deployment
    Replies: 0
    Last Post: 29th March 2011, 17:18
  4. Compile Qtcreator with mingw ?
    By tonnot in forum Installation and Deployment
    Replies: 13
    Last Post: 3rd November 2010, 22:00
  5. compile with minGW ??
    By eric in forum Qt Programming
    Replies: 4
    Last Post: 8th November 2007, 00:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.