Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Sqldrivers: Postgresql not found while it is installed and configured (win 8.1, Psql 9.6.6, Qt 5.10.0, MSVC2015_x64)

Sqldrivers: Postgresql not found while it is installed and configured (win 8.1, Psql 9.6.6, Qt 5.10.0, MSVC2015_x64)

Scheduled Pinned Locked Moved Unsolved General and Desktop
sqldrivermsvc2015postgresql
5 Posts 3 Posters 4.1k Views
  • 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.
  • D Offline
    D Offline
    dawidp
    wrote on 9 Feb 2018, 13:22 last edited by
    #1

    My setup:

    • Windows 8.1 Pro 64bit
    • Qt 5.10.0 (in C:\Qt)
    • QMake version 3.1 (Using Qt version 5.10.0 in C:/Qt/5.10.0 /msvc2015_64/lib)
    • PostgreSQL 9.6.6 64bit (in C:\Postgresql\9.6)
    • Microsoft Visual Studio Community 2015 (Version 14.0.25431.01 Update 3)

    I'm trying to build Postgresql driver fot QT but is not found. First i went to http://doc.qt.io/qt-5/sql-driver.html and executed:

    C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\psql>qmake "INCLUDEPATH+=C:/Postgresql/9.6/include" "LIBS+=C:/Postgresql/9.6/lib/libpq.lib" psql.pro
    

    but got error

    Cannot read C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: File not found.
    Project ERROR: Library 'psql' is not defined.
    

    that file C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri doesn't exists so I've searched the internet and found that I need to run qmake sqldrivers.pro so

    C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers>qmake sqldrivers.pro
    Running configuration tests...
    Checking for DB2 (IBM)... no
    Checking for InterBase... no
    Checking for MySQL... no
    Checking for OCI (Oracle)... no
    Checking for ODBC... yes
    Checking for PostgreSQL... no
    Checking for SQLite (version 2)... no
    Checking for TDS (Sybase)... no
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'nmake'.
    Once everything is built, Qt is installed.
    You should NOT run 'nmake install'.
    Note that this build cannot be deployed to other machines or devices.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    WTH? I have postgresql installed and I have pg_config in path

    C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers>pg_config
    BINDIR = C:/POSTGR~1/9.6/bin
    DOCDIR = C:/POSTGR~1/9.6/doc
    HTMLDIR = C:/POSTGR~1/9.6/doc
    INCLUDEDIR = C:/POSTGR~1/9.6/include
    PKGINCLUDEDIR = C:/POSTGR~1/9.6/include
    INCLUDEDIR-SERVER = C:/POSTGR~1/9.6/include/server
    LIBDIR = C:/POSTGR~1/9.6/lib
    PKGLIBDIR = C:/POSTGR~1/9.6/lib
    LOCALEDIR = C:/POSTGR~1/9.6/share/locale
    MANDIR = C:/Postgresql/9.6/man
    SHAREDIR = C:/POSTGR~1/9.6/share
    SYSCONFDIR = C:/Postgresql/9.6/etc
    PGXS = C:/Postgresql/9.6/lib/pgxs/src/makefiles/pgxs.mk
    CONFIGURE = --enable-thread-safety --enable-integer-datetimes --enable-nls --with-ldap --with-openssl --with-ossp-uuid --with-libxml --with-libxslt --with-tcl --with-perl --with-python
    CC = niezarejestrowane
    CPPFLAGS = niezarejestrowane
    CFLAGS = niezarejestrowane
    CFLAGS_SL = niezarejestrowane
    LDFLAGS = niezarejestrowane
    LDFLAGS_EX = niezarejestrowane
    LDFLAGS_SL = niezarejestrowane
    LIBS = niezarejestrowane
    VERSION = PostgreSQL 9.6.6
    
    C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers>
    

    Now my questions is: Why Postgresql isn't detected ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Feb 2018, 21:54 last edited by
      #2

      Hi and welcome to devnet,

      Is your PostgreSQL installation built with the same version as Qt ?

      You should also add the "INCLUDEPATH+=C:/Postgresql/9.6/include" "LIBS+=C:/Postgresql/9.6/lib/libpq.lib" parameters to your qmake call in the sqldrivers 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
      • D Offline
        D Offline
        dawidp
        wrote on 10 Feb 2018, 08:25 last edited by dawidp 2 Oct 2018, 08:29
        #3

        I've installed binary version of Postgresql 9.6.6 from enterprisedb.com (redirected from postgresql.org for Windows binary distributions) so I don't know with which compiler was used to build it. And Qt installer was download from Qt website. I did not compile Qt ot Postgresql.

        I'll try to compile Postgresql from souces....

        J 1 Reply Last reply 12 Feb 2018, 06:15
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 10 Feb 2018, 09:56 last edited by
          #4

          Before building something, you can use Dependency Walker for example to check the architecture. That also must match.

          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
          • D dawidp
            10 Feb 2018, 08:25

            I've installed binary version of Postgresql 9.6.6 from enterprisedb.com (redirected from postgresql.org for Windows binary distributions) so I don't know with which compiler was used to build it. And Qt installer was download from Qt website. I did not compile Qt ot Postgresql.

            I'll try to compile Postgresql from souces....

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 12 Feb 2018, 06:15 last edited by
            #5

            @dawidp said in Sqldrivers: Postgresql not found while it is installed and configured (win 8.1, Psql 9.6.6, Qt 5.10.0, MSVC2015_x64):

            And Qt installer was download from Qt website

            The Qt installer can install any officially provided Qt version, so you should know what Qt version you actually installed.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            2/5

            9 Feb 2018, 21:54

            • Login

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