Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. PostgreSQL plugin building in Windows 7
Forum Updated to NodeBB v4.3 + New Features

PostgreSQL plugin building in Windows 7

Scheduled Pinned Locked Moved Installation and Deployment
18 Posts 2 Posters 8.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #6

    First things, you should move/reinstall PostgreSQL in a folder without space, it will save you a lot of troubles.

    And you should call qmake directly in the plugin folder

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TerraxQt
      wrote on last edited by
      #7

      Hello Sgaist,

      Today I uninstalled PostgreSQL which was 64-bit and installed the 32-bit version. After that I opened the console from Start menu->All Programs->Qt 5.1.1->5.1.1->MinGW 4.8 (32-bit)->Qt 5.1.1 for Desktop.

      After that I went in C:\Qt\Qt5.1.1\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql
      and executed the command:

      C:\Qt\Qt5.1.1\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql>qmake INCLUDE+="C:\PostgreSQL\9.3\include" LIBS+="C:\PostgreSQL\9.3\lib\libpq.lib"

      After that I executed mingw32-make and it started to print output (which is something new) but ended with error. Below is the whole output with the errors at the end:

      C:\Qt\Qt5.1.1\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql>mingw32-make
      mingw32-make -f Makefile.Release all
      mingw32-make[1]: Entering directory 'C:/Qt/Qt5.1.1/5.1.1/Src/qtbase/src/plugins/
      sqldrivers/psql'
      C:\Qt\Qt5.1.1\5.1.1\mingw48_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 -D__GNUC__ -DWIN32 -I. -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include" -I"
      C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtSql" -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32
      include\QtSql\5.1.1" -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtSql\5.1.1\QtSql
      " -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore" -I"C:\Qt\Qt5.1.1\5.1.1\mingw
      48_32\include\QtCore\5.1.1" -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\5.1
      .1\QtCore" -I".moc\release_shared" -I"........\mkspecs\win32-g++" main.cpp -o
      .moc\release_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:\Qt\Qt5.1.1
      \5.1.1\mingw48_32\include" -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtSql" -I"C
      :\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtSql\5.1.1" -I"C:\Qt\Qt5.1.1\5.1.1\mingw4
      8_32\include\QtSql\5.1.1\QtSql" -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore
      " -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\5.1.1" -I"C:\Qt\Qt5.1.1\5.1.1
      \mingw48_32\include\QtCore\5.1.1\QtCore" -I".moc\release_shared" -I"........
      mkspecs\win32-g++" -o .obj\release_shared\main.o main.cpp
      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:\Qt\Qt5.1.1
      \5.1.1\mingw48_32\include" -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtSql" -I"C
      :\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtSql\5.1.1" -I"C:\Qt\Qt5.1.1\5.1.1\mingw4
      8_32\include\QtSql\5.1.1\QtSql" -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore
      " -I"C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\5.1.1" -I"C:\Qt\Qt5.1.1\5.1.1
      \mingw48_32\include\QtCore\5.1.1\QtCore" -I".moc\release_shared" -I"........
      mkspecs\win32-g++" -o .obj\release_shared\qsql_psql.o ......\sql\drivers\psql
      qsql_psql.cpp
      ......\sql\drivers\psql\qsql_psql.cpp:59:22: fatal error: libpq-fe.h: No such
      file or directory
      #include <libpq-fe.h>
      ^
      compilation terminated.
      Makefile.Release:493: recipe for target '.obj/release_shared/qsql_psql.o' failed

      mingw32-make[1]: *** [.obj/release_shared/qsql_psql.o] Error 1
      mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.1.1/5.1.1/Src/qtbase/src/plugins/s
      qldrivers/psql'
      makefile:38: recipe for target 'release-all' failed
      mingw32-make: *** [release-all] Error 2

      Please advise. Your help is much appreciated.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #8

        It can't find the libpq-fe.h header file, are you sure you added the include path where that file can be found ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • T Offline
          T Offline
          TerraxQt
          wrote on last edited by
          #9

          The file is in C:\PostgreSQL\9.3\include:

          !http://imageshack.com/a/img545/2936/i5kg.jpg(libpq-fe)!

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #10

            Change the \ to / for the paths you give to qmake. Also on windows Qt uses unix style path, so you are giving it invalid paths.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • T Offline
              T Offline
              TerraxQt
              wrote on last edited by
              #11

              same result :)

              ......\sql\drivers\psql\qsql_psql.cpp:59:22: fatal error: libpq-fe.h: No such
              file or directory
              #include <libpq-fe.h>
              ^
              compilation terminated.
              Makefile.Release:493: recipe for target '.obj/release_shared/qsql_psql.o' failed

              mingw32-make[1]: *** [.obj/release_shared/qsql_psql.o] Error 1
              mingw32-make[1]: Leaving directory 'C:/Qt/5.1.1/Src/qtbase/src/plugins/sqldriver
              s/psql'
              makefile:38: recipe for target 'release-all' failed
              mingw32-make: *** [release-all] Error 2

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #12

                Check the content of the Makefile to see if there's a line containing the path to PostgreSQL includes

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  TerraxQt
                  wrote on last edited by
                  #13

                  The Makefile which is in C:/Qt/5.1.1/Src/qtbase/src/plugins/sqldrivers/psql has the line:

                  Command: C:\Qt\5.1.1\mingw48_32\bin\qmake.exe INCLUDE+=“C:/PostgreSQL/9.3/include” LIBS+=“C:/PostgreSQL/9.3/lib/libpq.lib” -o Makefile psql.pro

                  The Makefile which is in C:\Qt\5.1.1\mingw48_32\bin has the line:

                  Command: C:\Qt\5.1.1\mingw48_32\bin\qmake.exe "INCLUDEPATH+=C:\Program Files\PostgreSQL\9.3\include" "LIBS+=C:\Program Files\PostgreSQL\9.3\lib\libpq.lib" -o Makefile C:\Qt\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql\psql.pro

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #14

                    Why do you have a Makefile in the C:\Qt\5.1.1\mingw48_32\bin folder ?

                    You should clean everything and then try to build the plugin again

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      TerraxQt
                      wrote on last edited by
                      #15

                      I don't know why there is a Makefile :) By clean everything you mean re-install Qt and PostgreSQL ?

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #16

                        No, PostgreSQL seems to be installed fine, just clean the sources and check whether you have something unusual in the mingw related folders

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          TerraxQt
                          wrote on last edited by
                          #17

                          Here is what I did:
                          -Re-installed Qt
                          -Opened the Console from Qt's folder in start menu
                          -Executed:

                          C:\Qt\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql>qmake INCLUDEPATH+="C:/PostgreSQL/9.3/include" LIBS+="C:/PostgreSQL/9.3/lib/libpq.lib

                          After that:
                          C:\Qt\5.1.1\Src\qtbase\src\plugins\sqldrivers\psql>mingw32-make

                          And the result:

                                       from c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\incl
                          

                          ude\c++\bits\stl_algo.h:65,
                          from c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\incl
                          ude\c++\algorithm:62,
                          from C:\Qt\5.1.1\mingw48_32\include/QtCore/qglobal.h:80,
                          from C:\Qt\5.1.1\mingw48_32\include/QtCore/qnamespace.h:45,
                          from C:\Qt\5.1.1\mingw48_32\include/QtCore/qobjectdefs.h:45,
                          from C:\Qt\5.1.1\mingw48_32\include/QtCore/qobject.h:48,
                          from C:\Qt\5.1.1\mingw48_32\include/QtCore/qplugin.h:45,
                          from C:\Qt\5.1.1\mingw48_32\include\QtSql/qsqldriverplugin.h:45
                          ,
                          from main.cpp:42:
                          c:\qt\tools\mingw48_32\i686-w64-mingw32\include\sys\timeb.h:90:8: error: previou
                          s definition of 'struct timespec'
                          struct timespec {
                          ^
                          Makefile.Release:397: 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/5.1.1/Src/qtbase/src/plugins/sqldriver
                          s/psql'
                          makefile:38: recipe for target 'release-all' failed
                          mingw32-make: *** [release-all] Error 2

                          Is it possible that for Qt ver. 5.1.1 the building of the plugin is done in different way?

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #18

                            Just stumbled upon "this":http://qt-project.org/forums/viewthread/24460
                            Worth a try

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved