Results 1 to 15 of 15

Thread: PostgreSQL driver support

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: PostgreSQL driver support

    I created the .pri file called psql.pri with the following:

    INCLUDEPATH += $$PWD\include
    DEPENDPATH += $$PWD\lib

    I placed the file into the c:\psql directory. I copied the libpq.lib file to the C:\Qt\2009.04\qt\lib directory. Do I do a configure -plugin-sql-psql or run qmake?

  2. #2
    Join Date
    Feb 2008
    Posts
    50
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: PostgreSQL driver support

    Quote Originally Posted by treyhaslem View Post
    I created the .pri file called psql.pri with the following:

    INCLUDEPATH += $$PWD\include
    DEPENDPATH += $$PWD\lib

    I placed the file into the c:\psql directory. I copied the libpq.lib file to the C:\Qt\2009.04\qt\lib directory. Do I do a configure -plugin-sql-psql or run qmake?
    After u made the pri file go to C:\Qt\4.5.3\src\plugins\sqldrivers\psql
    Open psql.pro and add:

    include(C:\psql\psql.pri)

    Then open a command prompt, cd to where psql.pro is, qmake, make/nmake. I don`t remember if u needed to make install, but do it anyway. The libraries will go to Qt`s plugins dir.

  3. #3
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: PostgreSQL driver support

    I can make the libraries but Qt still will not list PostgreSQL as an available database.

  4. #4
    Join Date
    Jan 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: PostgreSQL driver support

    Quote Originally Posted by treyhaslem View Post
    I can make the libraries but Qt still will not list PostgreSQL as an available database.
    I had this problem before and it was resolved with this three steps
    -In the prompt go to: cd %QTDIR%
    -Then execute the comand: configure -debug-and-release -platform win32-g++ -qt-sql-psql -qt-gif -I C:\PostgreSQL8.1\include -L C:\PostgreSQL8.1\lib
    - Finish with: make (or mingw32-make)

  5. #5
    Join Date
    Feb 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: PostgreSQL driver support

    I'm trying to make psql driver available in Qt 4.7 but still no luck.

    I manage to compile the driver and build it, all go well, the driver and the libraries were created, but still isn't in the list of available drivers.

    Then I make a configure -debug-and-release -platform win32-g++ -qt-sql-psql -I C:\PostgreSQL\9.0\include -L C:\PostgreSQL\9.0\lib, and then mingw32-make, using a Qt commanda prompt and all goes well 'till the psql driver compilation, it gave and error.

    I went to the qt\src\plugins\sqldrivers\psql\ and execute mingw32-make Makefile.Debug all (which is exactly where the other make file gave an error) and the make finish ok, the go to qt\ and execute mingw32-make again and this time gave an error on the sqlite driver compìlation; repeat the above steps go to the src\plugins .. and again build ok.

    Execute again mingw32-make in the qt\ directory and gave an error in the bearer\generic plugin, again if I go to the directory and build it, the build goes ok;
    this keep happening to all plugins, i get tired in the imageformats\gif. This are the errors:

    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
    DQT_DLL -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\.
    .\include\QtCore" -I"..\..\..\..\include\QtGui" -I"..\..\..\..\include" -I"c:\Po
    stgreSQL\9.0\include" -I"..\..\..\gui\image" -I"..\..\..\..\include\ActiveQt" -I
    "tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared
    \qgifhandler.o ..\..\..\gui\image\qgifhandler.cpp
    g++: CreateProcess: No such file or directory
    mingw32-make[4]: *** [tmp/obj/debug_shared/qgifhandler.o] Error 1
    mingw32-make[4]: Leaving directory `C:/Qt/2010.05/qt/src/plugins/imageformats/gif'
    mingw32-make[3]: *** [debug-all] Error 2
    mingw32-make[3]: Leaving directory `C:/Qt/2010.05/qt/src/plugins/imageformats/gif'
    mingw32-make[2]: *** [sub-gif-make_default] Error 2
    mingw32-make[2]: Leaving directory `C:/Qt/2010.05/qt/src/plugins/imageformats'
    mingw32-make[1]: *** [sub-imageformats-make_default] Error 2
    mingw32-make[1]: Leaving directory `C:/Qt/2010.05/qt/src/plugins'
    mingw32-make: *** [sub-plugins-make_default-ordered] Error 2

    And still the qpsql driver isn't available. Does anybody find a solution for this.

    Thanks.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: PostgreSQL driver support

    You don't need to build the whole Qt if the only thing you are after is recompilation of one sql plugin. Build the plugin and copy it where it belongs, nothing more.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Feb 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: PostgreSQL driver support

    Thanks for your reply, it is where it belongs in qt\plugins\sqldrivers\psql; but still don't appear to be available.

    Could it be possible that the plugin do not find the libpq?

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: PostgreSQL driver support

    Yes, it could be possible that it can't find libpq. Use Dependency Walker to see whether its dependencies are met. Also be sure to build the plugin in the right mode (release vs debug).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. PostgreSQL driver and Window 7
    By lasher in forum Installation and Deployment
    Replies: 0
    Last Post: 6th October 2009, 16:51
  2. Qt/X11 source-distro apps corrupting KDE Desktop background
    By wdezell in forum Installation and Deployment
    Replies: 5
    Last Post: 23rd July 2009, 21:10
  3. Qt-4.4.0 installation error in linux
    By babu198649 in forum Installation and Deployment
    Replies: 4
    Last Post: 27th May 2008, 14:35
  4. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  5. QT4 and Postgresql driver
    By alphaqt in forum Installation and Deployment
    Replies: 6
    Last Post: 27th February 2006, 15:50

Tags for this Thread

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.