I don't remember so well, but I think was: yes or plugin
I don't remember so well, but I think was: yes or plugin
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
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
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??
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
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?
"If you lie to the compiler, it will get its revenge." - Henry Spencer
My folder structure looks like this for the release version:
Qt Code:
./myapp.exe ./comerr32.dll (version 1.3.5.0) ./krb5_32.dll (version 1.3.5.0) ./libeay32.dll (version 0.9.8.1) ./libiconv-2.dll ./libintl-2.dll ./libpq.dll (version 8.1.5.6286) ./ssleay32.dll (version 0.9.8.1) ./sqldrivers/qsqlpsql.dll ./qtcore4.dll ./qtsql4.dll ./qtgui4.dllTo 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
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
Actually my libpq is the one that was shipped with the pgsql binaries, what about using that one?
"If you lie to the compiler, it will get its revenge." - Henry Spencer
I'm sorry but I can't!!
I did a search in my windows to find this dll, but the search finished with no results!!
Which psql package did you install? Perhaps it's a development package you have to build yourself. However, there are binary packages available for sure too.
J-P Nurmi
Bookmarks