this is wrong
I mean libpq.dll must be libpq.a for creation this lib you need apply dlltool (which is located in bin dir of mingw) for libpq.dll.LIBS+=c:\Program Files\PostgreSQL\8.3\lib\libpq.dll
this is wrong
I mean libpq.dll must be libpq.a for creation this lib you need apply dlltool (which is located in bin dir of mingw) for libpq.dll.LIBS+=c:\Program Files\PostgreSQL\8.3\lib\libpq.dll
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Thanks for finding error. I found dlltool at bin directory of MinGW.
now what should i do.
Regards
Narasimha Raju. Naidu
this should help you
edit: link updated.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Hi,
Thanks for your replies and references. I did according to the instruction in the link. it successfully generated libpq.a file.
What should i do now.....
Waiting for your reply
Regards,
Narasimha Raju. Naidu
do this
that's all.qmake "INCLUDEPATH+=%POSTGRESQLDIR%\include" "LIBS+=%POSTGRESQLDIR%\lib\libpq.a" psql.pro
mingw32-make
PS. I forgot, for successfully launching application with PSQL driver you need to add PostgreSQL's bin directory to your PATH variable.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
thanks for your reply. i did according to your instructions but i got the following result
C:\Qt\4.3.4\src\plugins\sqldrivers\psql>qmake "INCLUDEPATH+=C:\Program Files\Pos
tgreSQL\8.3\include" "LIBS+=c:\Program Files\PostgreSQL\8.3\lib\libpq.a" psql.pr
o
C:\Qt\4.3.4\src\plugins\sqldrivers\psql>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN
-DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -
I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\inclu
de\QtSql" -I"..\..\..\..\include" -I"c:\Program" -I"Files\PostgreSQL\8.3\include
" -I"c:\Qt\4.3.4\include\ActiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\
..\mkspecs\win32-g++" -o tmp\obj\release_shared\qsql_psql.o ..\..\..\sql\drivers
\psql\qsql_psql.cpp
..\..\..\sql\drivers\psql\qsql_psql.cpp:57: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:147: error: `PQerrorMessage' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:147: 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:157: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:158: error: `PGRES_TUPLES_OK' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:161: error: `PQntuples' undeclared (firs
t use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:163: 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:241: 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:269: 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:274: error: `PQnfields' undeclared (firs
t use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:278: error: `PQftype' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:280: error: `PQgetvalue' undeclared (fir
st use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:281: error: `PQgetisnull' undeclared (fi
rst use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:343: 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:357: error: `PQgetvalue' undeclared (fir
st use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:358: 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:370: 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:381: 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:387: error: `Oid' undeclared (first use
this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:387: error: expected `;' before "id"
..\..\..\sql\drivers\psql\qsql_psql.cpp:388: error: `id' undeclared (first use t
his function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:388: 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:400: error: `PQnfields' undeclared (firs
t use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:404: error: `PQfname' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:407: error: `PQftype' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:408: error: `PQfsize' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:409: 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:427: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:428: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:429: error: `PQclear' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:430: 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:435: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:436: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:437: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:438: error: `PQerrorMessage' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:439: 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:444: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:445: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:446: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
.
.
.
..\..\..\sql\drivers\psql\qsql_psql.cpp:576: 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:596: 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:614: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:615: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:615: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:616: 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:631: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:632: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:632: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:633: 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:648: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:649: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:649: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:652: 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:920: 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:946: error: `PQstatus' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:946: error: `CONNECTION_OK' undeclared (
first use this function)
mingw32-make[1]: *** [tmp/obj/release_shared/qsql_psql.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
mingw32-make: *** [release] Error 2
C:\Qt\4.3.4\src\plugins\sqldrivers\psql>
Regards,
Narasimha Raju
are you sure that this path "C:\Program Files\PostgreSQL\8.3\include" is corrent? is libpq-fe.h located in "C:\Program Files\PostgreSQL\8.3\include"?
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
yes all are correct but still i am getting same errors
ok, try to make the next:
>cd %QTDIR%\src\plugins\sqldrivers\psql
>SET POSTGREDIR="C:\Program Files\PostgreSQL\8.3"
>SET INCLUDE=%POSTGREDIR%\include;%INCLUDE%
>SET LIB=%POSTGREDIR%\lib;%LIB%
>qmake
>mingw32-make
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
hi i did according to your instructions. I got the following out put
C:\Qt\4.3.4\src\plugins\sqldrivers\psql>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
C:/Qt/4.3.4/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -
DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE
_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\Q
tCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..\..\..\.
.\include" -I"c:\Qt\4.3.4\include\ActiveQt" -I"tmp\moc\release_shared" -I"." -I"
C:\Program Files\PostgreSQL\8.3\include" -I"%INCLUDE%" -I"..\..\..\..\mkspecs\wi
n32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\psql\qsql_psql.h -o tmp\moc\rel
ease_shared\moc_qsql_psql.cpp
moc: Too many input files specified
Usage: moc [options] <header-file>
-o<file> write output to file rather than stdout
-I<dir> add dir to the include path for header files
-E preprocess only; do not generate meta object code
-D<macro>[=<def>] define macro, with optional definition
-U<macro> undefine macro
-i do not generate an #include statement
-p<path> path prefix for included file
-f[<file>] force #include, optional file name
-nw do not display warnings
-v display version of moc
mingw32-make[1]: *** [tmp/moc/release_shared/moc_qsql_psql.cpp] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
mingw32-make: *** [release] Error 2
C:\Qt\4.3.4\src\plugins\sqldrivers\psql>
Regards,
Narasimha Raju. Naidu
Hi i think you are busy?? i sent the result after executing your specified instruction. What should i do. I am waiting for your reply
Regards,
Narasimha Raju. Naidu
Problem is with spaces in Yours PostgreSQL dir name (c:\Program Files\PostgreSQL\8.3). Try this :
Look at differently located char " in INCLUDEPATH and LIBS.Qt Code:
qmake INCLUDEPATH+="C:\Program Files\Pos tgreSQL\8.3\include" LIBS+="c:\Program Files\PostgreSQL\8.3\lib\libpq.a" psql.pr oTo copy to clipboard, switch view to plain text mode
Hi,
Good Morning, Thanks for your reply. I did changes what you mentiond in ur reply. I got the following output.
C:\Qt\4.3.4\src\plugins\sqldrivers\psql>qmake INCLUDEPATH="c:\Program Files\Post
greSQL\8.3\include" LIBS+="c:\Program Files\PostgreSQL\8.3\lib\libpq.a" psql.pro
C:\Qt\4.3.4\src\plugins\sqldrivers\psql>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.3.4\plugins\sqldrivers\
libqsqlpsql4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsql4.dll tmp/obj/release_s
hared/main.o tmp/obj/release_shared/qsql_psql.o tmp/obj/release_shared/moc_qsql_
psql.o -L"c:\Qt\4.3.4\lib" -L"c:\Qt\4.3.4\lib" tmp\obj\release_shared\qsqlpsql_
resource_res.o c:\Program Files\PostgreSQL\8.3\lib\libpq.a -lQtSql4 -lQtCore4
g++: c:\Program: No such file or directory
g++: Files\PostgreSQL\8.3\lib\libpq.a: No such file or directory
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsql4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
mingw32-make: *** [release] Error 2
I am waiting for your reply.
Regards,
Narasimha Raju. Naidu
reinstall PostgreSQL in other directory which will not contain any spaces and reapeat all steps again. now the problem only in paths with spaces.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Thanks for your reply. According to ur instructions i did the same thing. I got the following output
C:\MinGW\bin>dlltool --dllname libpq.dll --def libpq.def --output-lib libpq.a
dlltool: Can't open def file: libpq.def
C:\MinGW\bin>
Waiting for your reply
Regards,
Narasimha Raju. Naidu
read the post #13 and read Creating .def Files from DLLs section from specified link.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Thanks for your reply. According to your instructions
I tried to downolad impdef.exe but i got an error file not found error.
Waiting for your reply
Regards,
Narasimha Raju. Naidu
Bookmarks