Results 1 to 5 of 5

Thread: Problem: "QSqlDatabase: QPSQL driver not loaded" (Windows OS)

  1. #1
    Join Date
    May 2009
    Location
    Gran Canaria, Canary Islands, Spain
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Problem: "QSqlDatabase: QPSQL driver not loaded" (Windows OS)

    Hi, I have the following problem trying to connect to a PostgresSQL database with PostgreSL 8.3:

    Starting C:/Users/Alberto/Desktop/qttest/test1/debug/test1.exe...
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC


    In linux (ubuntu) it works, but not in Windows. I've googled a lot and actually I've found some "solutions", the problem is that I don't know how to carry out them. Anyway most of those solutions didn't really work, cause threads just ended up opened (with no final solution).

    The solution appears to be nice is the one explained in this post (only 5 short replies):

    http://www.qtcentre.org/forum/f-inst...ver-11171.html

    And it's the following (if I've understood it right):

    1. Use Dependency Walker with X (don't know how to use it, or the file I have to use it with)
    2. Copy X .dll files into the folder where the executable is placed (don't know which .dll files exactly)

    So the problem is that I don't understand it, or just don't know what do I have to do exactly. ¿Could any of you please guide me with this issue?.

    Additional data that may be useful:
    - Qt version: Qt 4.5.1 (the current newest one: qt-sdk-win-opensource-2009.02.exe, it also includes Qt-Creator 1.1.0 and MinGW 5.1.4)
    - OS: Windows Vista
    - PostgreSQL version: 8.3.7

    Thanks in advance,

    Alberto.
    Last edited by Alberto++; 3rd May 2009 at 20:04.

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem: "QSqlDatabase: QPSQL driver not loaded" (Windows OS)

    In general it means that you don't have QPSQL driver which is needed for connecting to PostgreSQL. For more information look here: http://doc.trolltech.com/4.5/sql-dri...-7-3-and-above. There is also link at the end of that part: Compiling PostgreSQL On Native Win32 FAQ.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem: "QSqlDatabase: QPSQL driver not loaded" (Windows OS)

    try to search by forum, this question was discussed many times.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. #4
    Join Date
    May 2009
    Location
    Gran Canaria, Canary Islands, Spain
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem: "QSqlDatabase: QPSQL driver not loaded" (Windows OS)

    Oks, thanks, I'll try those webs, faldżip. If I get blocked I'll continue searching in the forum. And if I don't solve the problem I'll ask again =).

  5. #5
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    122
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem: "QSqlDatabase: QPSQL driver not loaded" (Windows OS)

    Hi, I landed on this problem myself. I'm on windows and there is a special warning I would like to share with newbies like me:
    if you want to compile the Postgresdriver for windows and you have installed Postgres on
    c:\program files\Postgres\8.4
    then the space in the path means you cant just modify the example suggested in the Qt documentation by simple substitution.
    In other words the following call to qmake will not work
    qmake "INCLUDEPATH+=C:\Program Files\PostgreSQL\8.4\include" "LIBS+=C:\Program Files\PostgreSQL\8.4\lib\libpq.lib" psql.pro
    One way of getting around the problem is to
    fix the makefile which contains the following incorrect assignments inside the definition of
    INCPATH
    -I"c:\Program" -I"Files\PostgreSQL\8.4\include"
    replace these by
    -I"c:\Program Files\PostgreSQL\8.4\include"

    I dont know about doubling up the double quotes inside the strings ,maybe that's a better solution! In any case the user should be warned.

Similar Threads

  1. Replies: 19
    Last Post: 3rd April 2009, 23:17
  2. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57

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.