Results 1 to 20 of 32

Thread: QPSQL driver in windows

Hybrid View

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

    Default Re: QPSQL driver in windows

    You're attempting to compile a debug version of the application while you have no debug version of Qt itself built. Either build a release version of the application:
    make clean
    qmake -config release
    make
    or build a debug version of Qt (there is a shortcut in the start-menu in case you installed Qt from a binary installer, otherwise see "configure -help").
    J-P Nurmi

  2. #2
    Join Date
    Aug 2007
    Posts
    64
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    now it compilled but still saying:

    driver not Loaded

    I can't understand!! It works so well in Slackware 12!!
    Last edited by brevleq; 5th December 2007 at 20:44.

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

    Default Re: QPSQL driver in windows

    While running the Qt configure script, what was the output of:
    Sql Drivers:
    ...
    PostgreSQL..............??? <--
    J-P Nurmi

  4. #4
    Join Date
    Aug 2007
    Posts
    64
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    I don't remember so well, but I think was: yes or plugin

  5. #5
    Join Date
    Aug 2007
    Posts
    64
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    I did it again:

    configure -plugin-sql-psql
    make

    but this time:

    ...
    nclude\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..
    \..\..\..\include" -I"c:\Qt\4.3.2\include\ActiveQt" -I"tmp\moc\debug_shared" -I"
    ." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qsql_psql.o ..\..\.
    .\sql\drivers\psql\qsql_psql.cpp
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:52:22: libpq-fe.h: No such file or direc
    tory
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In function `QSqlError qMakeError(const
    QString&, QSqlError::ErrorType, const QPSQLDriverPrivate*)':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:142: error: `PQerrorMessage' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:142: error: (Each undeclared identifier
    is reported only once for each function it appears in.)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `bool QPSQLResultPri
    vate:rocessResults()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:152: error: `PQresultStatus' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:153: error: `PGRES_TUPLES_OK' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:156: error: `PQntuples' undeclared (firs
    t use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:158: error: `PGRES_COMMAND_OK' undeclare
    d (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `void QPSQLResult::c
    leanup()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:236: error: `PQclear' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLR
    esult::fetchLast()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:264: error: `PQntuples' undeclared (firs
    t use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual QVariant QP
    SQLResult::data(int)':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:269: error: `PQnfields' undeclared (firs
    t use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:273: error: `PQftype' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:275: error: `PQgetvalue' undeclared (fir
    st use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:276: error: `PQgetisnull' undeclared (fi
    rst use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:338: error: `PQunescapeBytea' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLR
    esult::isNull(int)':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:352: error: `PQgetvalue' undeclared (fir
    st use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:353: error: `PQgetisnull' undeclared (fi
    rst use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLR
    esult::reset(const QString&)':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:365: error: `PQexec' undeclared (first u
    se this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual int QPSQLRe
    sult::numRowsAffected()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:376: error: `PQcmdTuples' undeclared (fi
    rst use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual QVariant QP
    SQLResult::lastInsertId() const':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:382: error: `Oid' undeclared (first use
    this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:382: error: expected `;' before "id"
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:383: error: `id' undeclared (first use t
    his function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:383: error: `InvalidOid' undeclared (fir
    st use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual QSqlRecord
    QPSQLResult::record() const':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:395: error: `PQnfields' undeclared (firs
    t use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:399: error: `PQfname' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:402: error: `PQftype' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:403: error: `PQfsize' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:404: error: `PQfmod' undeclared (first u
    se this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In function `bool setEncodingUtf8(PGcon
    n*)':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:422: error: `PQexec' undeclared (first u
    se this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:423: error: `PQresultStatus' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:424: error: `PQclear' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:425: error: `PGRES_COMMAND_OK' undeclare
    d (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In function `void setDatestyle(PGconn*)
    ':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:430: error: `PQexec' undeclared (first u
    se this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:431: error: `PQresultStatus' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:432: error: `PGRES_COMMAND_OK' undeclare
    d (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:433: error: `PQerrorMessage' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:434: error: `PQclear' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In function `QPSQLDriver::Protocol getP
    SQLVersion(PGconn*)':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:439: error: `PQexec' undeclared (first u
    se this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:440: error: `PQresultStatus' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:441: error: `PGRES_COMMAND_OK' undeclare
    d (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:441: error: `PGRES_TUPLES_OK' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:442: error: `PQgetvalue' undeclared (fir
    st use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:443: error: `PQclear' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In destructor `virtual QPSQLDriver::~QP
    SQLDriver()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:496: error: `PQfinish' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLD
    river:pen(const QString&, const QString&, const QString&, const QString&, int,
    const QString&)':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:569: error: `PQconnectdb' undeclared (fi
    rst use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:570: error: `PQstatus' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:570: error: `CONNECTION_BAD' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:571: error: `PQfinish' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual void QPSQLD
    river::close()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:591: error: `PQfinish' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLD
    river::beginTransaction()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:609: error: `PQexec' undeclared (first u
    se this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:610: error: `PQresultStatus' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:610: error: `PGRES_COMMAND_OK' undeclare
    d (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:611: error: `PQclear' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLD
    river::commitTransaction()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:626: error: `PQexec' undeclared (first u
    se this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:627: error: `PQresultStatus' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:627: error: `PGRES_COMMAND_OK' undeclare
    d (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:628: error: `PQclear' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLD
    river::rollbackTransaction()':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:643: error: `PQexec' undeclared (first u
    se this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:644: error: `PQresultStatus' undeclared
    (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:644: error: `PGRES_COMMAND_OK' undeclare
    d (first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:647: error: `PQclear' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual QString QPS
    QLDriver::formatValue(const QSqlField&, bool) const':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:915: error: `PQescapeBytea' undeclared (
    first use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLD
    river::isOpen() const':
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:941: error: `PQstatus' undeclared (first
    use this function)
    ..\..\..\sql\drivers\psql\qsql_psql.cpp:941: error: `CONNECTION_OK' undeclared (
    first use this function)
    mingw32-make[4]: *** [tmp\obj\debug_shared\qsql_psql.o] Error 1
    mingw32-make[4]: Leaving directory `C:/Qt/4.3.2/src/plugins/sqldrivers/psql'
    mingw32-make[3]: *** [debug-all] Error 2
    mingw32-make[3]: Leaving directory `C:/Qt/4.3.2/src/plugins/sqldrivers/psql'
    mingw32-make[2]: *** [sub-psql-make_default] Error 2
    mingw32-make[2]: Leaving directory `C:/Qt/4.3.2/src/plugins/sqldrivers'
    mingw32-make[1]: *** [sub-sqldrivers-make_default] Error 2
    mingw32-make[1]: Leaving directory `C:/Qt/4.3.2/src/plugins'
    mingw32-make: *** [sub-plugins-make_default-ordered] Error 2

  6. #6
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    You forgot to specify the lib and include path for the libpq.lib and postgre header files while running configure.
    However, it is not necessary to recompile qt with -plugin-sql-pgsql if managed to build the pgsql plugin. What you have to do is to put the qsqlpsql.dll file into a folder called "sqldrivers" in your application directory, and also put all the qsqlpsql.dll dependencies (libpq.dll, libeay32.dll etc) into your application directory. Only then the psql driver will be loaded properly.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  7. #7
    Join Date
    Aug 2007
    Posts
    64
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    I did what you said:

    C:\caixa_xpress\release>dir
    O volume na unidade C não tem nome.
    O número de série do volume é 4888-B441

    Pasta de C:\caixa_xpress\release

    06/12/2007 20:16 <DIR> .
    06/12/2007 20:16 <DIR> ..
    06/12/2007 20:10 495.104 caixa_xpress.exe
    12/10/2005 09:32 24.576 comerr32.dll
    25/10/2003 14:31 888.832 iconv.dll
    12/10/2005 09:32 524.288 krb5_32.dll
    03/11/2005 11:50 1.064.960 libeay32.dll
    10/11/2006 15:11 1.227.264 libgeos-2.dll
    10/11/2006 15:11 348.672 libgeos_c-1.dll
    31/01/2003 18:41 916.849 libiconv-2.dll
    01/02/2003 15:51 51.016 libintl-2.dll
    20/04/2007 11:22 186.822 libpq.dll
    10/11/2006 15:11 199.680 libproj.dll
    21/02/2006 12:10 4.025.444 libxml2-2.dll
    07/01/2006 10:39 946.688 libxml2.dll
    03/01/2006 19:16 153.088 libxslt.dll
    01/12/2006 23:03 1.869 Microsoft.VC80.CRT.manifest
    13/01/2005 17:19 15.960 mingwm10.dll
    02/12/2006 07:22 479.232 msvcm80.dll
    01/12/2006 23:03 548.864 msvcp80.dll
    01/12/2006 23:03 626.688 msvcr80.dll
    23/03/2007 16:01 69.632 pgaevent.dll
    16/04/2007 12:00 94.208 pgenlist.dll
    16/04/2007 12:01 94.208 pgenlista.dll
    17/04/2006 23:25 196.608 pgoledb.dll
    16/04/2007 12:00 110.592 pgxalib.dll
    16/04/2007 12:01 475.136 psqlodbc30a.dll
    16/04/2007 12:00 483.328 psqlodbc35w.dll
    04/06/2005 02:52 60.273 pthreadGC2.dll
    25/11/2007 18:27 2.078.720 QtCore4.dll
    01/10/2007 12:49 9.116.672 QtGui4.dll
    01/10/2007 12:50 291.328 QtSql4.dll
    06/12/2007 20:06 <DIR> sqldrivers
    03/11/2005 11:50 200.704 ssleay32.dll
    20/07/2005 11:48 59.904 zlib1.dll
    32 arquivo(s) 26.057.209 bytes
    3 pasta(s) 1.228.476.416 bytes disponÃ*veis

    C:\caixa_xpress\release\sqldrivers>dir
    O volume na unidade C não tem nome.
    O número de série do volume é 4888-B441

    Pasta de C:\caixa_xpress\release\sqldrivers

    06/12/2007 20:06 <DIR> .
    06/12/2007 20:06 <DIR> ..
    05/12/2007 17:36 81.408 qsqlpsql4.dll
    1 arquivo(s) 81.408 bytes
    2 pasta(s) 1.228.476.416 bytes disponÃ*veis

    but the message Driver not Loaded still appears!!

    I forgot some dll??

  8. #8
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    Quote Originally Posted by brevleq View Post
    but the message Driver not Loaded still appears!!

    I forgot some dll??
    If you want to check if some DLL is missing, run dependency walker on your exectuable / qsqlpsql.dll. Out of the top of my head it all looks fine.

    The psql plugin is built with the same build key as Qt? (That should be the case unless your specified your own build key, which is unlikely)
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  9. #9
    Join Date
    Aug 2007
    Posts
    64
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    Quote Originally Posted by Methedrine View Post
    The psql plugin is built with the same build key as Qt? (That should be the case unless your specified your own build key, which is unlikely)
    I didn't understand it!! How can I know if it is built with the same build key?

  10. #10
    Join Date
    Aug 2007
    Posts
    64
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    Quote Originally Posted by Methedrine View Post
    If you want to check if some DLL is missing, run dependency walker on your exectuable / qsqlpsql.dll.
    I runned dependency walker and It didn't found 2 dlls:

    LIBPQ.DLL
    MSJAVA.DLL

    I found these two files in internet!! The first I putted in my application/sqldrivers directory and the second in c:\windows\system
    I'm using postgre 8 and the libpq.dll is 7.0.2 have any problem with it?

  11. #11
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    Quote Originally Posted by brevleq View Post
    I didn't understand it!! How can I know if it is built with the same build key?
    If you did not specify a build key explicitely when running qconfigure, then rest assured - it will be the same.

    Quote Originally Posted by brevleq View Post
    I runned dependency walker and It didn't found 2 dlls:

    LIBPQ.DLL
    MSJAVA.DLL

    I found these two files in internet!! The first I putted in my application/sqldrivers directory and the second in c:\windows\system
    I'm using postgre 8 and the libpq.dll is 7.0.2 have any problem with it?
    I'll check this as soon as I am back home.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  12. #12
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    My folder structure looks like this for the release version:
    Qt Code:
    1. ./myapp.exe
    2. ./comerr32.dll (version 1.3.5.0)
    3. ./krb5_32.dll (version 1.3.5.0)
    4. ./libeay32.dll (version 0.9.8.1)
    5. ./libiconv-2.dll
    6. ./libintl-2.dll
    7. ./libpq.dll (version 8.1.5.6286)
    8. ./ssleay32.dll (version 0.9.8.1)
    9. ./sqldrivers/qsqlpsql.dll
    10. ./qtcore4.dll
    11. ./qtsql4.dll
    12. ./qtgui4.dll
    To copy to clipboard, switch view to plain text mode 

    This works perfectly fine. However, keep in mind that a debug build of your software should link against the debug qt libs (this includes the debug build of qsqlpsql.dll!).
    Considering that my libpq is a lot more recent than yours, I would not rule out the option that that might be a source of trouble, too.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  13. #13
    Join Date
    Aug 2007
    Posts
    64
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver in windows

    I think the problem is with libpq.dll!! In dependency walker it returned a error and the icon for this dll was red!!

    Can you send me your dll??

    brevleq@gmail.com

Similar Threads

  1. Can't find QPSQL driver!!
    By brevleq in forum Qt Programming
    Replies: 9
    Last Post: 30th October 2007, 00:29
  2. Windows not appearing in XP.
    By beardybloke in forum Qt Programming
    Replies: 7
    Last Post: 24th October 2007, 17:32
  3. Postgre driver mistic in windows
    By zlatko in forum Installation and Deployment
    Replies: 2
    Last Post: 13th March 2007, 13:15
  4. OCI Driver in Qt4 for Windows
    By DoNaLd in forum Installation and Deployment
    Replies: 2
    Last Post: 14th July 2006, 14:43
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 22:33

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.