Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24

Thread: PostgreSQL and Windows Community Version

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: PostgreSQL and Windows Community Version

    Quote Originally Posted by graeme
    configure -L C:\...\psql\lib -I C:\...\psql\include -plugin-sql-psql
    This will compile the QPSQL driver as a plugin.

    Quote Originally Posted by graeme
    configure -qt-sql-psql -I C:/pgsql/include -L C:/pgsql/lib
    And this should compile it into the Qt library.

  2. #22
    Join Date
    Jan 2006
    Posts
    40
    Thanks
    3
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: PostgreSQL and Windows Community Version

    It works Quite why I'm still a little perplexed but here is what I have done:

    1. Downloaded 4.1.2 src - previously I have 4.1.1 mingw installer
    2. Configured with: configure -debug-and-release -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg -qt-sql-psql -L C:\psql\lib
    3. Recompiled my app: placed the pgsql dlls in the same directory as the exe


    I had also done the following prior to configure
    Qt Code:
    1. set QTDIR=C:\Qt\4.1.2
    2. set PATH=C:\Qt\4.1.2\bin
    3. set PATH=%PATH%;C:\psql\include
    4. set PATH=%PATH%;C:\psql\lib
    5. set PATH=%PATH%;C:\MinGW\bin
    To copy to clipboard, switch view to plain text mode 
    So the differences are:

    1. Slightly newer version of Qt - doubt if that makes any difference
    2. I have the src rather than the installer - might make a difference
    3. I have compiled it into Qt rather than as a plugin - might make a difference, although I doubt it.


    When I get time I will compile Qt with pgsql as a plug in. I can't think of any difference at the moment.

    jacek, thank you very much for your support and your valuable ideas.

    graeme.
    Last edited by graeme; 18th April 2006 at 17:44.

  3. #23
    Join Date
    Jan 2006
    Posts
    109
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: PostgreSQL and Windows Community Version

    Quote Originally Posted by graeme
    Recompiled my app: placed the pgsql dlls in the same directory as the exe
    Most probably there used to be an issue with the PostgreSQL DLL's, which is why you were asked to run the Dependency Walker on the plugin. Unfortunately that didn't help.
    Quote Originally Posted by graeme
    I have compiled it into Qt rather than as a plugin - might make a difference, although I doubt it.
    Yes, that might make a difference, although it shouldn't.

  4. #24
    Join Date
    Jan 2006
    Location
    Lincoln, NE USA
    Posts
    177
    Thanks
    3
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: PostgreSQL and Windows Community Version

    Have you installed an ODBC driver for PostgreSQL?

    Try: psqlodbc-08_00_0101.zip

    Then set up an ODBC connection. I run PostgreSQL on a Linux server and connect to it from this W2K workstation using an ODBC driver setup through the ODBC Manager on the Control Panel.


    To compile PostgreSQL plugins.
    1) Install PostgreSQL and be careful to select the libraries for installation. (I installed every feature)
    2) Install QT4 for windows and use the following configure command:
    (In place of "C:\Progra~1\PostgreSQL...." point to where you installed PostgreSQL.)

    configure -plugin-sql-psql -qt-sql-psql
    -I C:\Progra~1\PostgreSQL\8.1\include
    -L C:\Progra~1\PostgreSQL\8.1\lib
    -L C:\Progra~1\PostgreSQL\8.1\lib\libpq.a

    cd E:\Qt\4.1.0\src\plugins\sqldrivers\psql
    qmake -o Makefile "INCLUDEPATH+=C:\Progra~1\PostgreSQL\8.1\inclu de" "LIBS+=C:\Progra~1\PostgreSQL\8.1\lib C:\Progra~1\PostgreSQL\8.1\lib\ms\libpq.lib" psql.pro
    qmake
    make or nmake

    and the plugins were installed in:
    E:\Qt\4.1.0\plugins\sqldrivers

    I use PostgreSQL 8.1.x as a standin for our Oracle server. IF I had my way we'd use PostgreSQL and not Oracle.

Similar Threads

  1. Qt and PostgreSQL : version not supported
    By xinevil in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2008, 14:00

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.