Results 1 to 9 of 9

Thread: Driver not loaded

  1. #1
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Driver not loaded

    Hello, i am new with qt/c++. I am trying to use postgresql driver( postgresql 8.2), but i got a error: Driver not loaded.
    I am using qt4.4.1(open source edition) on windows xp. I am using eclipse via Qt eclipse Integration v1.4.1.
    Everything is fine with postgres. I connected via java.
    My .pro is like
    ...
    INCLUDEPATH = "D:\Arquiv~1\PostgreSQL\8.2\include"
    QT += core \
    gui \
    sql \
    xml \
    ...
    LIBS += "D:\Arquiv~1\PostgreSQL\8.2\lib\ms\libpq.lib"
    ....

    I put the, dlls, qsqlpsql4.dll and qsqlpsqld4.dll on folder qtdir/ bin

    when i execute the snippet: qDebug() << QSqlDatabase::drivers(); got ("QSQLITE", "QODBC3", "QODBC")

    Somebody could help-me
    regards,
    Rogério

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Driver not loaded

    J-P Nurmi

  3. #3
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Driver not loaded

    cd %QTDIR%\src\plugins\sqldrivers\psql
    qmake -o Makefile "INCLUDEPATH+=D:\Arquiv~1\PostgreSQL\8.2\inclu de" "LIBS+=D:\Arquiv~1\PostgreSQL\8.2\lib\ms\libpq.lib " psql.pro
    make.

    yes, i did this before and got:
    qsqlpsqld4.dll; qsqlpsql4.dll; libqsqlpsqld4.a; libqsqlpsql4.a.
    The dlls were generated in folder qtdir\plugins\sqldrivers.

    The diference is that i used "make" not "nmake". I am using MinGW

    is missing something else to load driver psql?

    thanks,
    Rogério

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Driver not loaded

    You might need to add the PSQL DLL to PATH. You can open qsqlpsql4.dll to Dependency Walker to verify that loading the plugin is possible.
    J-P Nurmi

  5. #5
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Driver not loaded

    I tried something else. I compiled with nmake.
    qmake -o Makefile "INCLUDEPATH+=D:\Arquiv~1\PostgreSQL\8.2\inclu de" "LIBS+=D:\Arquiv~1\PostgreSQL\8.2\lib\ms\libpq .lib " psql.pro
    nmake.

    But, i have to compile my program with nmake Too.this way, I could load postgresql driver. If use make to compile, the program not work(Driver not load).

    I would like use (mingw)make. Is it possible use mingw(make)?


    regards,
    Rogério

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Driver not loaded

    If your psql library is built with MSVC, you cannot use it with a different compiler.
    J-P Nurmi

  7. The following user says thank you to jpn for this useful post:

    rogerio (23rd September 2008)

  8. #7
    Join Date
    Mar 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Can't compile driver

    I have a similar problem:
    I'm using Qt 4.5.0 with PostgreSQL 8.3 on Windows vista. The included documentation says to use this:

    cd %QTDIR%\src\plugins\sqldrivers\psql
    qmake -o Makefile "INCLUDEPATH+=C:\psql\include" "LIBS+=C:\psql\lib\ms\libpq.lib" psql.pro
    nmake

    Since installation of postgres doesn't have the ms dir i changed it to look like this:

    cd %QTDIR%\src\plugins\sqldrivers\psql
    qmake -o Makefile "INCLUDEPATH+=C:\psql\include" "LIBS+=C:\psql\lib\libpq.lib" psql.pro
    nmake

    First of all it tells me nmake is not a valid command so i use make. This completes without any recognizable errors but when i check QSqlDatabase::drivers() it tells me
    QSQLITE
    QODBC3
    QODBC Which are the drivers that Qt came with anyway

    What do I have to do to get this thing to compile?

  9. #8
    Join Date
    Mar 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Driver not loaded

    I solved the problem - well, kind of. Found the answer here http://qtwiki.org/QPSQL_driver_not_l...usual_solution

  10. #9
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Driver not loaded

    I have similar problem with MYSQL driver. From my app I get "Driver not loaded.". From QQSqlDatabase for availabe drivers I get: "QSQLITE QMYSQL3 QMYSQL QODBC3 QODBC". I've built plugin according to QtCentre's Wiki. I've copied qmysql.dll into qt's bin dir, which IS IN PATH. I have also added "+=SQL" into .pro file. What else can be wrong or what am I missing, please help!
    Qt 5.3 Opensource & Creator 3.1.2

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. mysql driver not loaded after deployment
    By tpf80 in forum Newbie
    Replies: 4
    Last Post: 4th September 2011, 10:12
  3. mysql 5 connection
    By GuL in forum Newbie
    Replies: 37
    Last Post: 18th August 2008, 15:11
  4. SQlite driver not loaded error
    By ibergmark in forum Installation and Deployment
    Replies: 2
    Last Post: 17th March 2008, 01:09
  5. exception at 0x65100c40 (QtGuid4.dll)
    By sabeesh in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2007, 17:10

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.