PDA

View Full Version : QPSQL problem



LoneWolf
13th March 2008, 15:22
Hi guys,
I am trying to connect qt in postgresql and it appears "DRIVER NOT LOADED DRIVER NOT LOADED". Why that?

PostgreSQL 8.3
Qt 4.3.3

My code:


#include <QApplication>
#include <QtSql>
#include <QSqlDriver>
#include <QSqlDatabase>
#include <QMessageBox>
#include <QObject>

bool createConnection() {

QSqlDatabase bd = QSqlDatabase::addDatabase("QPSQL");
bd.setHostName("localhost");
bd.setDatabaseName("Test");
if(!bd.open()) {
QMessageBox::critical(0, QObject::tr("DB - ERROR!"),
bd.lastError().text());
return false;
}
return true;

}

int main(int argc, char *argv[]) {

QApplication app(argc, argv);
if(!createConnection())
return 1;

return app.exec();
}

LoneWolf
13th March 2008, 15:25
ERROR IN CONSOLE AFTER MAKE:

ERROR in console:

mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..
\..\..\..\include" -I"c:\Program" -I"Files\Programas\PostgreSQL\lib" -I"c:\Qt\4.
3.3\include\ActiveQt" -I"tmp\moc\debug_shared" -I"." -I"..\..\..\..\mkspecs\win3
2-g++" -o tmp\obj\debug_shared\qsql_psql.o ..\..\..\sql\drivers\psql\qsql_psql.c
pp
..\..\..\sql\drivers\psql\qsql_psql.cpp:50: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:140: error: `PQerrorMessage' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:140: 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::processResults()':
..\..\..\sql\drivers\psql\qsql_psql.cpp:150: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:151: error: `PGRES_TUPLES_OK' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:154: error: `PQntuples' undeclared (firs
t use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:156: 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:234: 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:262: 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:267: error: `PQnfields' undeclared (firs
t use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:271: error: `PQftype' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:273: error: `PQgetvalue' undeclared (fir
st use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:274: error: `PQgetisnull' undeclared (fi
rst use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:336: 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:350: error: `PQgetvalue' undeclared (fir
st use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:351: 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:363: 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:374: 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:380: error: `Oid' undeclared (first use
this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:380: error: expected `;' before "id"
..\..\..\sql\drivers\psql\qsql_psql.cpp:381: error: `id' undeclared (first use t
his function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:381: 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:393: error: `PQnfields' undeclared (firs
t use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:397: error: `PQfname' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:400: error: `PQftype' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:401: error: `PQfsize' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:402: 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:420: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:421: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:422: error: `PQclear' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:423: 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:428: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:429: error: `PQresultStatus' 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:431: error: `PQerrorMessage' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:432: 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:437: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:438: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:439: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:439: error: `PGRES_TUPLES_OK' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:440: error: `PQgetvalue' undeclared (fir
st use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:441: 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:494: error: `PQfinish' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp: In member function `virtual bool QPSQLD
river::open(const QString&, const QString&, const QString&, const QString&, int,
const QString&)':
..\..\..\sql\drivers\psql\qsql_psql.cpp:567: error: `PQconnectdb' undeclared (fi
rst use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:568: error: `PQstatus' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:568: error: `CONNECTION_BAD' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:569: 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:589: 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:607: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:608: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:608: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:609: 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:624: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:625: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:625: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:626: 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:641: error: `PQexec' undeclared (first u
se this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:642: error: `PQresultStatus' undeclared
(first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:642: error: `PGRES_COMMAND_OK' undeclare
d (first use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:645: 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:913: 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:939: error: `PQstatus' undeclared (first
use this function)
..\..\..\sql\drivers\psql\qsql_psql.cpp:939: error: `CONNECTION_OK' undeclared (
first use this function)
mingw32-make[1]: *** [tmp/obj/debug_shared/qsql_psql.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
mingw32-make: *** [debug-all] Error 2


What can I do?

jpn
13th March 2008, 18:57
First of all, you need to install a PSQL development package (which provides required headers and libraries). Secondly, you need to pass suitable INCLUDEPATH and LIBS as parameters to qmake like advised in this article: How to Build the QPSQL Plugin on Windows (http://doc.trolltech.com/4.3/sql-driver.html#how-to-build-the-qpsql-plugin-on-windows).

LoneWolf
13th March 2008, 22:15
Hey,

Where do I find PSQL development package?

jpn
14th March 2008, 06:09
I believe it's the core distribution package from http://www.postgresql.org/download/.

LoneWolf
15th March 2008, 12:35
Hey,

What file/files do I download? ftp://ftp2.br.postgresql.org/postgresql/
I am lost. :)

hugs.

jpn
15th March 2008, 13:13
Try downloading ftp://ftp.fi.postgresql.org/pub/postgresql/binary/v8.3.0/win32/postgresql-8.3.0-1.zip.

In Installation Options, make sure to select "Include files" and "Library files" under "Development" section.

To avoid common space problems, you might also want to change the default installation path ("C:\Program Files\PostgreSQL\8.3") not to contain spaces (eg. "C:\psql").

Change to directory $QTDIR\src\plugins\sqldrivers\psql and follow given instructions: How to Build the QPSQL Plugin on Windows (http://doc.trolltech.com/4.3/sql-driver.html#how-to-build-the-qpsql-plugin-on-windows).

LoneWolf
15th March 2008, 15:03
Done, but some problems yet!

Reinstalled postgresql in c:/psql, but its not exists ms folder in /lib. "libpq.lib" is in /lib.

So...when I did:

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

Error:

mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.3.3\plugins\sqldrivers\libqsql
psqld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll tmp/obj/debug_shared/m
ain.o tmp/obj/debug_shared/qsql_psql.o tmp/obj/debug_shared/moc_qsql_psql.o -L"
c:\Qt\4.3.3\lib" -L"c:\Qt\4.3.3\lib" tmp\obj\debug_shared\qsqlpsqld_resource_res
.o C:\psql\lib\ms\libpq.lib -lQtSqld4 -lQtCored4
g++: C:\psql\lib\ms\libpq.lib: No such file or directory
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
mingw32-make: *** [debug-all] Error 2

So I tried:

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

ERROR:

mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.3.3\plugins\sqldrivers\libqsql
psqld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll tmp/obj/debug_shared/m
ain.o tmp/obj/debug_shared/qsql_psql.o tmp/obj/debug_shared/moc_qsql_psql.o -L"
c:\Qt\4.3.3\lib" -L"c:\Qt\4.3.3\lib" tmp\obj\debug_shared\qsqlpsqld_resource_res
.o C:\psql\lib\libpq.lib -lQtSqld4 -lQtCored4
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot fin
d -lQtSqld4
collect2: ld returned 1 exit status
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
mingw32-make: *** [debug-all] Error 2

What is that?

Thanks.
Hugs.

jpn
15th March 2008, 16:48
Argh, sorry. I didn't realize they were MSVC libs but you're using MinGW. Try converting them as MinGW libs (.lib -> .a) with reimp like it's done in this wiki article: Building the QMYSQL plugin on Windows using MinGW

LoneWolf
16th March 2008, 11:47
C:\psql\lib>reimp libpq.lib
'reimp' is not recognized as an internal or external command, operable program or batch file.

Did I do something wrong? :confused: :(

ps.: My O.S. is Windows Vista.

jpn
16th March 2008, 12:31
reimp is part of mingw-utils (http://sourceforge.net/project/showfiles.php?group_id=2435&release_id=115457)

LoneWolf
16th March 2008, 13:12
ERROR:

C:\psql\lib>reimp libpq.lib

C:\Qt\4.3.3\src\plugins\sqldrivers\psql>qmake -o Makefile "INCLUDEPATH+=C:\psql\
include" "LIBS+=C:\psql\lib\liblibpq.a" psql.pro

C:\Qt\4.3.3\src\plugins\sqldrivers\psql>make
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.3.3\plugins\sqldrivers\libqsql
psqld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll tmp/obj/debug_shared/m
ain.o tmp/obj/debug_shared/qsql_psql.o tmp/obj/debug_shared/moc_qsql_psql.o -L"
c:\Qt\4.3.3\lib" -L"c:\Qt\4.3.3\lib" tmp\obj\debug_shared\qsqlpsqld_resource_res
.o C:\psql\lib\liblibpq.a -lQtSqld4 -lQtCored4
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot fin
d -lQtSqld4
collect2: ld returned 1 exit status
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
mingw32-make: *** [debug-all] Error 2




C:\psql\lib>reimp libpq.lib

is it libpq.lib or another .lib file?

Suggestion? :o

jpn
16th March 2008, 17:32
cannot find -lQtSqld4
Ok, we're getting closer. :) Now the problem is that you're trying to compile something in debug mode but you don't have debug version of Qt built. I recommend you build the plugin in release mode instead:

qmake -config release -o Makefile "INCLUDEPATH+=C:\psql\include" "LIBS+=C:\psql\lib\liblibpq.a" psql.pro

LoneWolf
16th March 2008, 20:00
Yeah, closer and closer...

So, I did:

C:\Qt\4.3.3\src\plugins\sqldrivers\psql>qmake -config release -o Makefile "INCLU
DEPATH+=C:\psql\include" "LIBS+=C:\psql\lib\liblibpq.a" psql.pro

And:

C:\Qt\4.3.3\src\plugins\sqldrivers\psql>make

In beginning it was all right, but after that...
ERROR:

Creating library file: c:\Qt\4.3.3\plugins\sqldrivers\libqsqlpsql4.a
tmp/obj/release_shared/qsql_psql.o(.text+0x54):qsql_psql.cpp: undefined referenc
e to `PQerrorMessage'
tmp/obj/release_shared/qsql_psql.o(.text+0x32b):qsql_psql.cpp: undefined referen
ce to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x4f0):qsql_psql.cpp: undefined referen
ce to `PQntuples'
tmp/obj/release_shared/qsql_psql.o(.text+0x834):qsql_psql.cpp: undefined referen
ce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0xb34):qsql_psql.cpp: undefined referen
ce to `PQntuples'
tmp/obj/release_shared/qsql_psql.o(.text+0xbac):qsql_psql.cpp: undefined referen
ce to `PQnfields'
tmp/obj/release_shared/qsql_psql.o(.text+0xc22):qsql_psql.cpp: undefined referen
ce to `PQftype'
tmp/obj/release_shared/qsql_psql.o(.text+0xc61):qsql_psql.cpp: undefined referen
ce to `PQgetvalue'
tmp/obj/release_shared/qsql_psql.o(.text+0xc95):qsql_psql.cpp: undefined referen
ce to `PQgetisnull'
tmp/obj/release_shared/qsql_psql.o(.text+0xe2c):qsql_psql.cpp: undefined referen
ce to `PQunescapeBytea'
tmp/obj/release_shared/qsql_psql.o(.text+0xe6b):qsql_psql.cpp: undefined referen
ce to `PQfreemem'
tmp/obj/release_shared/qsql_psql.o(.text+0x15d9):qsql_psql.cpp: undefined refere
nce to `PQgetvalue'
tmp/obj/release_shared/qsql_psql.o(.text+0x15f8):qsql_psql.cpp: undefined refere
nce to `PQgetisnull'
tmp/obj/release_shared/qsql_psql.o(.text+0x1765):qsql_psql.cpp: undefined refere
nce to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x1936):qsql_psql.cpp: undefined refere
nce to `PQcmdTuples'
tmp/obj/release_shared/qsql_psql.o(.text+0x1a6f):qsql_psql.cpp: undefined refere
nce to `PQoidValue'
tmp/obj/release_shared/qsql_psql.o(.text+0x1c1a):qsql_psql.cpp: undefined refere
nce to `PQnfields'
tmp/obj/release_shared/qsql_psql.o(.text+0x1cc2):qsql_psql.cpp: undefined refere
nce to `PQfname'
tmp/obj/release_shared/qsql_psql.o(.text+0x1d3a):qsql_psql.cpp: undefined refere
nce to `PQftype'
tmp/obj/release_shared/qsql_psql.o(.text+0x1d6a):qsql_psql.cpp: undefined refere
nce to `PQfsize'
tmp/obj/release_shared/qsql_psql.o(.text+0x1d8b):qsql_psql.cpp: undefined refere
nce to `PQfmod'
tmp/obj/release_shared/qsql_psql.o(.text+0x1e0d):qsql_psql.cpp: undefined refere
nce to `PQftype'
tmp/obj/release_shared/qsql_psql.o(.text+0x1e83):qsql_psql.cpp: undefined refere
nce to `PQfname'
tmp/obj/release_shared/qsql_psql.o(.text+0x1f45):qsql_psql.cpp: undefined refere
nce to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x1f53):qsql_psql.cpp: undefined refere
nce to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x1f7c):qsql_psql.cpp: undefined refere
nce to `PQgetvalue'
tmp/obj/release_shared/qsql_psql.o(.text+0x1fa8):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x27cb):qsql_psql.cpp: undefined refere
nce to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x289b):qsql_psql.cpp: undefined refere
nce to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x296b):qsql_psql.cpp: undefined refere
nce to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x2eab):qsql_psql.cpp: undefined refere
nce to `PQconnectdb'
tmp/obj/release_shared/qsql_psql.o(.text+0x2efc):qsql_psql.cpp: undefined refere
nce to `PQstatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x2f4f):qsql_psql.cpp: undefined refere
nce to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x2f5d):qsql_psql.cpp: undefined refere
nce to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x2f71):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x2fa4):qsql_psql.cpp: undefined refere
nce to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x2fb2):qsql_psql.cpp: undefined refere
nce to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x2fc3):qsql_psql.cpp: undefined refere
nce to `PQerrorMessage'
tmp/obj/release_shared/qsql_psql.o(.text+0x2fed):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x35c8):qsql_psql.cpp: undefined refere
nce to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x373b):qsql_psql.cpp: undefined refere
nce to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x38cc):qsql_psql.cpp: undefined refere
nce to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x38db):qsql_psql.cpp: undefined refere
nce to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x3900):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3a0d):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3abc):qsql_psql.cpp: undefined refere
nce to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x3acb):qsql_psql.cpp: undefined refere
nce to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x3ae4):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3bfd):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3cac):qsql_psql.cpp: undefined refere
nce to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x3cbb):qsql_psql.cpp: undefined refere
nce to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x3d74):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3dec):qsql_psql.cpp: undefined refere
nce to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x8048):qsql_psql.cpp: undefined refere
nce to `PQescapeBytea'
tmp/obj/release_shared/qsql_psql.o(.text+0x80a4):qsql_psql.cpp: undefined refere
nce to `PQfreemem'
tmp/obj/release_shared/qsql_psql.o(.text+0x8612):qsql_psql.cpp: undefined refere
nce to `PQstatus'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsql4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/plugins/sqldrivers/psql'
mingw32-make: *** [release-all] Error 2

:) Thanks !

jpn
16th March 2008, 20:39
Looks like it doesn't find required symbols in libpq.a. Anyway, I'm sorry but I don't know where's the problem, with reimp or what... I guess you could try compiling whole PSQL with MinGW (you might need MSYS for that) unless you can find readily available binaries somewhere on the internet.

LoneWolf
16th March 2008, 21:16
I dont know how MSYS works. Somebody has some idea? How do I clean all files created after my commands? So, I can try to do everything again.

Thanks.
Hugs.

jpn
16th March 2008, 21:19
How do I clean all files created after my commands? So, I can try to do everything again.
Try "make distclean".

LoneWolf
16th March 2008, 21:25
After that command, can I build QT in debug mode ?

jpn
16th March 2008, 21:33
Did you install Qt from a binary installer? If so, there's a link in Start-menu for building debug libs. But still, it won't solve the original problem...

LoneWolf
16th March 2008, 21:59
Oh...so I will not lose my time....hehehhee :D
is it really libpq.lib? Cause there is a postgres.lib and anothers .libs in psql/lib.

How do -L and -I parameters work?

LoneWolf
17th March 2008, 01:23
Hey,

ran 'make distcle' and later I tried:


configure -release -qt-sql-psql -I C:\psql\include -L C:\psql\lib

After a long time...

ERROR:

C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot find -lpq
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\lib\QtSql4.dll] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.3.3/src/sql'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/sql'
mingw32-make: *** [sub-sql-make_default-ordered] Error 2

Am I closer or...? :)

Hugs.

jpn
17th March 2008, 15:09
It's looking for libpq.a in C:\psql\lib\.

LoneWolf
18th March 2008, 00:18
Strange error:


g++: OBJECTS_DIR: No such file or directory
g++: =: No such file or directory
mingw32-make[2]: *** [..\..\..\bin\rcc.exe] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.3.3/src/tools/rcc'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/tools/rcc'
mingw32-make: *** [sub-rcc-make_default-ordered] Error 2

LoneWolf
19th March 2008, 02:15
Somebody help me? :o

LoneWolf
19th March 2008, 11:58
I uninstalled and installed qt and try:



C:\Qt\4.3.3>configure -release
C:\Qt\4.3.3>make


...


gcc: installation problem, cannot exec `cc1': No such file or directory
mingw32-make[2]: *** [tmp/obj/release_shared/adler32.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.3.3/src/tools/rcc'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/tools/rcc'
mingw32-make: *** [sub-rcc-make_default-ordered] Error 2

What is that?

jpn
19th March 2008, 15:56
Don't just blindly run configure script and expect it to do something. You must always examine the configure output. The configure script detected MSVC in your environment. You would have noticed that if you took a look at configure output.

Either make sure there are no MSVC tools in PATH or explicitly pass "-platform win32-g++" to configure to make it use MinGW. Again, verify this by examining the configure output.

LoneWolf
20th March 2008, 11:51
I uninstalled qt 4.3.3, mingw and installed qt 4.3.4, mingw.

I ran:


C:\Qt\4.3.4>configure -release -platform win32-g++ -qt-sql-psql -I C:\psql\include -L C:\psql\lib

and 'make'...


cc: installation problem, cannot exec `cc1': No such file or directory
ingw32-make[2]: *** [tmp/obj/release_shared/adler32.o] Error 1
ingw32-make[2]: Leaving directory `C:/Qt/4.3.4/src/tools/rcc'
ingw32-make[1]: *** [release] Error 2
ingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/tools/rcc'
ingw32-make: *** [sub-rcc-make_default-ordered] Error 2

And sorry, but I don't understand consoles's output, for that I post here...:o

I really need that...:(

Thanks.

jpn
20th March 2008, 11:58
I uninstalled qt 4.3.3, mingw and installed qt 4.3.4, mingw.
What did you install, exactly? What are the file names of these packages you installed?



I ran:


C:\Qt\4.3.4>configure -release -platform win32-g++ -qt-sql-psql -I C:\psql\include -L C:\psql\lib


Post the configure script summary which is shown before it starts reading .pro files.

LoneWolf
20th March 2008, 12:07
I downloaded and installed qt-win-opensource-4.3.4-mingw.exe.

Before it starts reading .pro files:

Environment:
INCLUDE=
Unset
LIB=
Unset
PATH=
C:\Qt\4.3.4\bin
C:\MinGW\bin
C:\Windows\System32
You are licensed to use this software under the terms of the GNU GPL version 2 o
r 3.
See C:/Qt/4.3.4/LICENSE.GPL2
or C:/Qt/4.3.4/LICENSE.GPL3

Configuration:
minimal-config
small-config
medium-config
large-config
full-config
release
Qt Configuration:
release
zlib
png
accessibility
qt3support
opengl
ipv6
minimal-config
small-config
medium-config
large-config
full-config

QMAKESPEC...................win32-g++ (commandline)
Architecture................windows
Maketool....................mingw32-make
Debug symbols...............no
Accessibility support.......yes
STL support.................yes
Exception support...........yes
RTTI support................yes
MMX support.................no
3DNOW support...............no
SSE support.................no
SSE2 support................no
OpenGL support..............yes
Direct3D support............no
OpenSSL support.............no
QDBus support...............no
Qt3 compatibility...........yes

Third Party Libraries:
ZLIB support............qt
GIF support.............plugin
TIFF support............plugin
JPEG support............plugin
PNG support.............qt
MNG support.............plugin

Styles:
Windows.................yes
Windows XP..............yes
Windows Vista...........yes
Plastique...............yes
Cleanlooks..............yes
Motif...................yes
CDE.....................yes

Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............yes
TDS.....................no
DB2.....................no
SQLite..................plugin (qt)
SQLite2.................no
InterBase...............no
Sources are in..............C:\Qt\4.3.4
Build is done in............C:\Qt\4.3.4
Install prefix..............C:\Qt\4.3.4
Headers installed to........C:/Qt/4.3.4/include
Libraries installed to......C:/Qt/4.3.4/lib
Plugins installed to........C:/Qt/4.3.4/plugins
Binaries installed to.......C:/Qt/4.3.4/bin
Docs installed to...........C:/Qt/4.3.4/doc
Data installed to...........C:/Qt/4.3.4
Translations installed to...C:/Qt/4.3.4/translations
Examples installed to.......C:/Qt/4.3.4/examples
Demos installed to..........C:/Qt/4.3.4/demos

Include paths...............C:\psql\include
Additional libraries........-LC:\psql\lib
Creating qmake...
g++ -c -oqconfig.o -O -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Ige
nerators/mac -IC:\Qt\4.3.4/src/corelib/arch/generic -IC:\Qt\4.3.4/include -IC:\Q
t\4.3.4/include/QtCore -IC:\Qt\4.3.4/include -IC:\Qt\4.3.4/include/QtCore -IC:\Q
t\4.3.4/src/corelib/global -IC:\Qt\4.3.4/include/QtScript -IC:\Qt\4.3.4/mkspecs/
win32-g++ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PC
RE -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUI
LD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM
-DQMAKE_OPENSOURCE_EDITION C:\Qt\4.3.4/src/corelib/global/qconfig.cpp
g++ -o qmake.exe project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.
o option.o winmakefile.o projectgenerator.o property.o meta.o makefiledeps.o met
amakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o msvc_nmake.o msvc_dsp.o m
svc_vcproj.o msvc_objectmodel.o qbitarray.o qbuffer.o qbytearray.o qcryptographi
chash.o qvsnprintf.o qbytearraymatcher.o qconfig.o qdatetime.o qdir.o qdiriterat
or.o qfile.o qtemporaryfile.o qfileinfo.o qabstractfileengine.o qfsfileengine.o
qfsfileengine_iterator.o qfsfileengine_win.o qfsfileengine_iterator_win.o qgloba
l.o qhash.o qiodevice.o qlibraryinfo.o qlistdata.o qlinkedlist.o qlocale.o qmap.
o qregexp.o qstring.o qstringlist.o qtextstream.o quuid.o qvector.o qurl.o qsett
ings.o qsettings_win.o qvariant.o qmetatype.o qnumeric.o qscriptasm.o qscriptast
.o qscriptastvisitor.o qscriptcompiler.o qscriptecmaarray.o qscriptecmaboolean.o
qscriptecmacore.o qscriptecmadate.o qscriptecmafunction.o qscriptecmaglobal.o q
scriptecmamath.o qscriptecmanumber.o qscriptecmaobject.o qscriptecmaregexp.o qsc
riptecmastring.o qscriptecmaerror.o qscriptcontext_p.o qscriptengine.o qscripten
gine_p.o qscriptextenumeration.o qscriptextvariant.o qscriptcontext.o qscriptfun
ction.o qscriptgrammar.o qscriptlexer.o qscriptclassdata.o qscriptparser.o qscri
ptprettypretty.o qscriptsyntaxchecker.o qscriptvalue.o qscriptvalueimpl.o qscrip
tvalueiterator.o -lole32 -luuid
copy qmake.exe C:\Qt\4.3.4\bin\qmake.exe
1 file(s) copied.

jpn
20th March 2008, 12:22
qt-win-opensource-4.3.4-mingw.exe is so called "binary installer". It gives you a pre-built, fully functional Qt installation. Why do you want to rebuild whole Qt? As for the original problem, you just need to get the PSQL plugin built in a way or another.

LoneWolf
20th March 2008, 12:43
Ok.

So, I follow:
http://wiki.qtcentre.org/index.php?title=Building_the_QMYSQL_plugin_on_Wind ows_using_MinGW


C:\Qt\4.3.4\src\plugins\sqldrivers\psql>qmake -o Makefile "INCLUDEPATH+=C:\psql\include" "LIBS+=C:\psql\lib\liblibpq.a" psql.pro

And 'make'.


gcc: installation problem, cannot exec `cc1': No such file or directory
windres: no resources
mingw32-make[1]: *** [tmp/obj/release_shared/qsqlpsql_resource_res.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
mingw32-make: *** [release] Error 2

Did I do something wrong?:confused:

Thanks.

jpn
20th March 2008, 12:44
Are you using Qt Command Prompt?

LoneWolf
20th March 2008, 12:46
Yes, I do.

'cc1' is in C:\MinGW\libexec\gcc\mingw32\3.4.2\

Hugs.

jpn
20th March 2008, 12:57
But not in C:\MinGW\bin? And there were no problems/nags/anything suspicious during MinGW installation?

LoneWolf
20th March 2008, 13:07
No, 'cc1' is not in C:\MinGW\bin\
I installed mingw through qt installer....anything suspicious for me.

I copied cc1 and put in C:\MinGW\bin\

Ran same commands above...


tmp/obj/release_shared/qsql_psql.o(.text+0x54):qsql_psql.cpp: undefined reference to `PQerrorMessage'
tmp/obj/release_shared/qsql_psql.o(.text+0x32b):qsql_psql.cpp: undefined reference to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x4f0):qsql_psql.cpp: undefined reference to `PQntuples'
tmp/obj/release_shared/qsql_psql.o(.text+0x834):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0xb34):qsql_psql.cpp: undefined reference to `PQntuples'
tmp/obj/release_shared/qsql_psql.o(.text+0xbac):qsql_psql.cpp: undefined reference to `PQnfields'
tmp/obj/release_shared/qsql_psql.o(.text+0xc22):qsql_psql.cpp: undefined reference to `PQftype'
tmp/obj/release_shared/qsql_psql.o(.text+0xc61):qsql_psql.cpp: undefined reference to `PQgetvalue'
tmp/obj/release_shared/qsql_psql.o(.text+0xc95):qsql_psql.cpp: undefined reference to `PQgetisnull'
tmp/obj/release_shared/qsql_psql.o(.text+0xe2c):qsql_psql.cpp: undefined reference to `PQunescapeBytea'
tmp/obj/release_shared/qsql_psql.o(.text+0xe6b):qsql_psql.cpp: undefined reference to `PQfreemem'
tmp/obj/release_shared/qsql_psql.o(.text+0x15d9):qsql_psql.cpp: undefined reference to `PQgetvalue'
tmp/obj/release_shared/qsql_psql.o(.text+0x15f8):qsql_psql.cpp: undefined reference to `PQgetisnull'
tmp/obj/release_shared/qsql_psql.o(.text+0x1765):qsql_psql.cpp: undefined reference to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x1936):qsql_psql.cpp: undefined reference to `PQcmdTuples'
tmp/obj/release_shared/qsql_psql.o(.text+0x1a6f):qsql_psql.cpp: undefined reference to `PQoidValue'
tmp/obj/release_shared/qsql_psql.o(.text+0x1c1a):qsql_psql.cpp: undefined reference to `PQnfields'
tmp/obj/release_shared/qsql_psql.o(.text+0x1cc2):qsql_psql.cpp: undefined reference to `PQfname'
tmp/obj/release_shared/qsql_psql.o(.text+0x1d3a):qsql_psql.cpp: undefined reference to `PQftype'
tmp/obj/release_shared/qsql_psql.o(.text+0x1d6a):qsql_psql.cpp: undefined reference to `PQfsize'
tmp/obj/release_shared/qsql_psql.o(.text+0x1d8b):qsql_psql.cpp: undefined reference to `PQfmod'
tmp/obj/release_shared/qsql_psql.o(.text+0x1e0d):qsql_psql.cpp: undefined reference to `PQftype'
tmp/obj/release_shared/qsql_psql.o(.text+0x1e83):qsql_psql.cpp: undefined reference to `PQfname'
tmp/obj/release_shared/qsql_psql.o(.text+0x1f45):qsql_psql.cpp: undefined reference to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x1f53):qsql_psql.cpp: undefined reference to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x1f7c):qsql_psql.cpp: undefined reference to `PQgetvalue'
tmp/obj/release_shared/qsql_psql.o(.text+0x1fa8):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x27cb):qsql_psql.cpp: undefined reference to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x289b):qsql_psql.cpp: undefined reference to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x296b):qsql_psql.cpp: undefined reference to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x2eab):qsql_psql.cpp: undefined reference to `PQconnectdb'
tmp/obj/release_shared/qsql_psql.o(.text+0x2efc):qsql_psql.cpp: undefined reference to `PQstatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x2f4f):qsql_psql.cpp: undefined reference to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x2f5d):qsql_psql.cpp: undefined reference to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x2f71):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x2fa4):qsql_psql.cpp: undefined reference to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x2fb2):qsql_psql.cpp: undefined reference to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x2fc3):qsql_psql.cpp: undefined reference to `PQerrorMessage'
tmp/obj/release_shared/qsql_psql.o(.text+0x2fed):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x35c8):qsql_psql.cpp: undefined reference to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x373b):qsql_psql.cpp: undefined reference to `PQfinish'
tmp/obj/release_shared/qsql_psql.o(.text+0x38cc):qsql_psql.cpp: undefined reference to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x38db):qsql_psql.cpp: undefined reference to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x3900):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3a0d):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3abc):qsql_psql.cpp: undefined reference to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x3acb):qsql_psql.cpp: undefined reference to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x3ae4):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3bfd):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3cac):qsql_psql.cpp: undefined reference to `PQexec'
tmp/obj/release_shared/qsql_psql.o(.text+0x3cbb):qsql_psql.cpp: undefined reference to `PQresultStatus'
tmp/obj/release_shared/qsql_psql.o(.text+0x3d74):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x3dec):qsql_psql.cpp: undefined reference to `PQclear'
tmp/obj/release_shared/qsql_psql.o(.text+0x8048):qsql_psql.cpp: undefined reference to `PQescapeBytea'
tmp/obj/release_shared/qsql_psql.o(.text+0x80a4):qsql_psql.cpp: undefined reference to `PQfreemem'
tmp/obj/release_shared/qsql_psql.o(.text+0x8612):qsql_psql.cpp: undefined reference to `PQstatus'
collect2: ld returned 1 exit status
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

Oh god!! :(

LoneWolf
24th March 2008, 00:08
Nobody knows about this problem?
I am desperate.

jpn
24th March 2008, 10:34
Well, looks like the conversion from .lib to .a doesn't succeed or is insufficient for some reason. So the option left is to build PSQL libs directly with MinGW/MSYS.


Download and install MSYS-1.0.10.exe: MinGW - Download (http://www.mingw.org/download.shtml)
Download and unpack postgresql-8.3.1.tar.gz (http://wwwmaster.postgresql.org/download/mirrors-ftp) (within MSYS env)
Run "./configure --without-zlib" and "make install" (within MSYS env) as instructed at: Compiling PostgreSQL On Native Win32 FAQ (http://www.postgresql.org/docs/faqs.FAQ_MINGW.html)
Attempt rebuilding Qt's PSQL-plugin by passing INCLUDEPATH and LIBS to your fresh PSQL installation


For example:

qmake -o Makefile "INCLUDEPATH+=C:\MSYS\local\pgsql\include" "LIBS+=C:\MSYS\local\pgsql\lib\libpq.a" psql.pro

LoneWolf
24th March 2008, 13:45
After make install:


make[3]: *** No rule to make target `utf8_and_shift_jis_2004.o', needed by `libutf8_and_shift_jis_2004.dll'. Stop.
make[3]: Leaving directory `/c/teste/psql/src/backend/utils/mb/conversion_procs/utf8_and_shift_jis_2004'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/c/teste/psql/src/backend/utils/mb/conversion_procs'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/c/teste/psql/src'
make: *** [install] Error 2


I gonna try one thing here....see you...

jpn
24th March 2008, 14:02
Well, maybe there is something wrong with your MinGW installation after all because for me it compiled just fine. I mean both, PostgreSQL compiled fine in MSYS environment and QPSQL plugin compiled just fine in Qt Command Prompt after passing it include paths and libs like I have shown above. I have MinGW 3.4.2 installed by the Qt binary installer without any additional tricks (oh and btw, seems that I have cc1.exe only in C:\MinGW\libexec\gcc\mingw32\3.4.2).

LoneWolf
24th March 2008, 15:02
I think God doesnt like me!

I installed MinGW 3.4.2 through qt installer. is it a problem?

Dont you have cc1.exe in c:\mingw\bin?

Dont I have to copy some .dlls to somewhere? Just remering...I have Windows Vista.

thanks.

jpn
24th March 2008, 15:19
I installed MinGW 3.4.2 through qt installer. is it a problem?
No, that's the recommended way while working with Qt. That's the version guaranteed to work flawlessly together with Qt.


Dont you have cc1.exe in c:\mingw\bin?
Nope.


Dont I have to copy some .dlls to somewhere?
Sorry, to do what? On Windows, DLLs are not needed for building. They are loaded at runtime. The corresponding .lib or .a is needed at compile time.


Just remering...I have Windows Vista.
That must be it... :p

Anyway, could you show the output of "./configure --without-zlib"?

LoneWolf
24th March 2008, 15:27
I had copied cc1.exe to mingw/bin...

Deleted cc1.exe from mingw/bin and tried './configure --without-zlib' in MSYS:


checking for C compiler default output file name... configure: error: C compiler cannot create executables

jpn
24th March 2008, 15:32
Just curious, what if you try to install MinGW somewhere else than C root?

LoneWolf
24th March 2008, 15:54
I gonna try...

Now output with cc1.exe copied to mingw/bin


checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking which template to use... win32
checking whether to build with 64-bit integer date/time support... no
checking whether NLS is wanted... no
checking for default port number... 5432
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking if gcc supports -Wdeclaration-after-statement... yes
checking if gcc supports -Wendif-labels... yes
checking if gcc supports -fno-strict-aliasing... yes
checking if gcc supports -fwrapv... yes
configure: using CFLAGS=-O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv
checking whether the C compiler still works... yes
checking how to run the C preprocessor... gcc -E
checking allow thread-safe client libraries... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with Kerberos 5 support... no
checking whether to build with PAM support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
configure: WARNING: *** Readline does not work on MinGW --- disabling
checking for egrep... grep -E
configure: using CPPFLAGS= -I./src/include/port/win32 -DEXEC_BACKEND
configure: using LDFLAGS=-Wl,--allow-multiple-definition
checking for ld used by GCC... /mingw/bin/ld
checking if the linker (/mingw/bin/ld) is GNU ld... yes
checking for ranlib... ranlib
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for tar... /bin/tar
checking whether ln -s works... yes
checking for gawk... gawk
checking for bison... no
configure: WARNING:
*** Without Bison you will not be able to build PostgreSQL from CVS nor
*** change any of the parser definition files. You can obtain Bison from
*** a GNU mirror site. (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this, because the Bison
*** output is pre-generated.) To use a different yacc program (possible,
*** but not recommended), set the environment variable YACC before running
*** 'configure'.
checking for flex... no
configure: WARNING:
*** Without Flex you will not be able to build PostgreSQL from CVS or
*** change any of the scanner definition files. You can obtain Flex from
*** a GNU mirror site. (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)
checking for perl... /c/Perl/bin/perl
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... no
checking for library containing socket... no
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... no
checking for library containing fdatasync... no
checking for library containing shmget... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking crypt.h usability... no
checking crypt.h presence... no
checking for crypt.h... no
checking dld.h usability... no
checking dld.h presence... no
checking for dld.h... no
checking fp_class.h usability... no
checking fp_class.h presence... no
checking for fp_class.h... no
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking langinfo.h usability... no
checking langinfo.h presence... no
checking for langinfo.h... no
checking poll.h usability... no
checking poll.h presence... no
checking for poll.h... no
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking sys/ipc.h usability... no
checking sys/ipc.h presence... no
checking for sys/ipc.h... no
checking sys/poll.h usability... no
checking sys/poll.h presence... no
checking for sys/poll.h... no
checking sys/pstat.h usability... no
checking sys/pstat.h presence... no
checking for sys/pstat.h... no
checking sys/resource.h usability... no
checking sys/resource.h presence... no
checking for sys/resource.h... no
checking sys/select.h usability... no
checking sys/select.h presence... no
checking for sys/select.h... no
checking sys/sem.h usability... no
checking sys/sem.h presence... no
checking for sys/sem.h... no
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/shm.h usability... no
checking sys/shm.h presence... no
checking for sys/shm.h... no
checking sys/tas.h usability... no
checking sys/tas.h presence... no
checking for sys/tas.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/un.h usability... no
checking sys/un.h presence... no
checking for sys/un.h... no
checking termios.h usability... no
checking termios.h presence... no
checking for termios.h... no
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking kernel/OS.h usability... no
checking kernel/OS.h presence... no
checking for kernel/OS.h... no
checking kernel/image.h usability... no
checking kernel/image.h presence... no
checking for kernel/image.h... no
checking SupportDefs.h usability... no
checking SupportDefs.h presence... no
checking for SupportDefs.h... no
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... no
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for preprocessor stringizing operator... yes
checking for signed types... yes
checking for working volatile... yes
checking for __func__... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... no
checking for tzname... no
checking for union semun... no
checking for struct sockaddr_un... no
checking for struct sockaddr_storage... yes
checking for struct sockaddr_storage.ss_family... yes
checking for struct sockaddr_storage.__ss_family... no
checking for struct sockaddr_storage.ss_len... no
checking for struct sockaddr_storage.__ss_len... no
checking for struct sockaddr.sa_len... no
checking for struct addrinfo... yes
checking for struct cmsgcred... no
checking for struct fcred... no
checking for struct sockcred... no
checking for struct option... yes
checking for int timezone... yes
checking types of arguments for accept()... unsigned int PASCAL, unsigned int, s truct sockaddr *, int *
checking whether gettimeofday takes only one argument... no
checking for cbrt... yes
checking for dlopen... no
checking for fcvt... yes
checking for fdatasync... no
checking for getpeereid... no
checking for getrlimit... no
checking for memmove... yes
checking for poll... no
checking for pstat... no
checking for readlink... no
checking for setproctitle... no
checking for setsid... no
checking for sigprocmask... no
checking for symlink... no
checking for sysconf... no

LoneWolf
24th March 2008, 15:55
...


checking for towlower... yes
checking for utime... yes
checking for utimes... no
checking for waitpid... no
checking for wcstombs... yes
checking whether fdatasync is declared... no
checking whether posix_fadvise is declared... no
checking whether strlcat is declared... no
checking whether strlcpy is declared... no
checking whether F_FULLFSYNC is declared... no
checking for struct sockaddr_in6... yes
checking for PS_STRINGS... no
checking whether snprintf is declared... yes
checking whether vsnprintf is declared... yes
checking for isinf... yes
checking for crypt... no
checking for fseeko... no
checking for getopt... yes
checking for getrusage... no
checking for inet_aton... no
checking for random... no
checking for rint... yes
checking for srandom... no
checking for strdup... yes
checking for strerror... yes
checking for strlcat... no
checking for strlcpy... no
checking for strtol... yes
checking for strtoul... yes
checking for unsetenv... no
checking for getaddrinfo... no
checking for getopt_long... yes
checking for gettimeofday... no
checking for sigsetjmp... no
checking whether sys_siglist is declared... no
checking for syslog... no
checking for optreset... yes
checking for strtoll... yes
checking for strtoull... yes
checking for atexit... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for fseeko... (cached) no
checking test program... ok
checking whether long int is 64 bits... no
checking whether long long int is 64 bits... yes
checking for unsigned long... yes
checking size of unsigned long... 4
checking for size_t... yes
checking size of size_t... 4
checking for short... yes
checking alignment of short... 2
checking for int... yes
checking alignment of int... 4
checking for long... yes
checking alignment of long... 4
checking for long long int... yes
checking alignment of long long int... 8
checking for double... yes
checking alignment of double... 8
checking for int8... no
checking for uint8... no
checking for int64... no
checking for uint64... no
checking for sig_atomic_t... yes
checking for working memcmp... yes
checking for onsgmls... no
checking for nsgmls... no
checking for openjade... no
checking for jade... no
checking for DocBook V4.2... no
checking for DocBook stylesheets... no
checking for collateindex.pl... no
checking for sgmlspl... no
configure: WARNING: *** skipping thread test on Win32
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: src/include/pg_config.h is unchanged
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: src/interfaces/ecpg/include/ecpg_config.h is unchanged
config.status: linking ./src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking ./src/backend/port/dynloader/win32.c to src/backend/port/dynloader.c
config.status: linking ./src/backend/port/win32_sema.c to src/backend/port/pg_sema.c
config.status: linking ./src/backend/port/win32_shmem.c to src/backend/port/pg_shmem.c
config.status: linking ./src/backend/port/dynloader/win32.h to src/include/dynloader.h
config.status: linking ./src/include/port/win32.h to src/include/pg_config_os.h
config.status: linking ./src/makefiles/Makefile.win32 to src/Makefile.port
config.status: executing check_win32_symlinks commands

LoneWolf
24th March 2008, 23:56
I changed mingw dir and tried....

gcc: installation problem, cannot exec `cc1': No such file or directory
mingw32-make[2]: *** [tmp/obj/release_shared/adler32.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.3.4/src/tools/rcc'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/tools/rcc'
mingw32-make: *** [sub-rcc-make_default-ordered] Error 2

cc1.exe is only in mingw/libexec/gcc/3.4.2

:(

jpn
25th March 2008, 11:21
cc1.exe is only in mingw/libexec/gcc/3.4.2

Yeah, so do I. And it does work perfectly for me (on WinXP, though). This is what suggested to me in the first place that there might be something wrong with your toolchain installation... I have seen some Vista users on this forum but I never heard about such MinGW problem on Vista before.

LoneWolf
25th March 2008, 21:40
No more suggestions? :(

Does qt work with devc++? Would it easier?
I have Microsoft Visual C++ too....

LoneWolf
26th March 2008, 12:49
I added the following line in the Qt\bin\qtvars.bat :

SET PATH=%PATH%;C:\gcc\mingw\libexec\gcc\mingw32\3.4.2

And tried again....
'configure' is ok...
'make'...

ERROR:


In file included from ..\..\3rdparty\zlib\crc32.c:29:
..\..\3rdparty\zlib\/zutil.h:21:24: stddef.h: No such file or directory
..\..\3rdparty\zlib\/zutil.h:23:22: string.h: No such file or directory
..\..\3rdparty\zlib\/zutil.h:24:22: stdlib.h: No such file or directory
..\..\3rdparty\zlib\/zutil.h:38:23: errno.h: No such file or directory
..\..\3rdparty\zlib\crc32.c:36:24: limits.h: No such file or directory
mingw32-make[2]: *** [tmp/obj/release_shared/crc32.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.3.4/src/tools/rcc'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/tools/rcc'
mingw32-make: *** [debug-C__Qt_4_3_4_src_tools_rcc] Error 2

???

LoneWolf
27th March 2008, 02:07
I did somethings...
After mingw and qt installation:


C:\Qt\4.3.4\src\plugins\sqldrivers\psql>qmake -o Makefile "INCLUDEPATH+=C:\psql\include" "LIBS+=C:\psql\lib\libpq.lib" psql.pro
C:\Qt\4.3.4\src\plugins\sqldrivers\psql>make


Output:

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"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\psql\include" -I"c:\Qt\4.3.4\include\ActiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\main.o main.cpp
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"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\psql\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
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\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..\..\..\.
.\include" -I"c:\psql\include" -I"c:\Qt\4.3.4\include\ActiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\psql\qsql_psql.h -o tmp\moc\release_shared\moc_qsql_psql.cpp
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"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\psql\include" -I"c:\Qt\4.3.4\include\ActiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tmp
\obj\release_shared\moc_qsql_psql.o tmp\moc\release_shared\moc_qsql_psql.cpp
windres -i qsqlpsql_resource.rc -o tmp\obj\release_shared\qsqlpsql_resource_res.o --include-dir=.
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -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_shared/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:\psql\lib\libpq.lib -lQtSql4 -lQtCore4
Creating library file: c:\Qt\4.3.4\plugins\sqldrivers\libqsqlpsql4.a
mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'


Is everything right?

Do I need to do something more? Because it continues: "Driver not loaded Driver not loaded" when I try to run 'release\database.exe'.

Thanks.

jpn
27th March 2008, 06:26
I wonder how on the earth did you manage to link it against libpq.lib because it's still an MSVC library (.lib), not a MinGW library (.a). Anyway, is there anything missing when you open qsqlpsql4.dll to Dependency Walker (http://www.dependencywalker.com)? Do you have the PSQL DLL (not Qt plugin, but the PSQL library) in PATH?

LoneWolf
27th March 2008, 12:50
I copied all asked dlls to qtdir\plugins\sqldrivers...
Now dependency walker says: "Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module."

is it ok?
"Driver not loaded Driver not loaded" continues and qt\demo\sqlbrowser it doesnt show psql.
What do you have to do now?

What PATH? QTvars?

Thanks.
Hugs.

LoneWolf
28th March 2008, 16:20
Somebody help me, please. :(

LoneWolf
31st March 2008, 14:47
Somebody there???

janus
1st April 2008, 12:02
when i was building the plugin manually on windows i had to copy libpq.a to H:\PostgreSQL\8.2\lib\ms. I dont know if this helps you. But you got the same building error (in your previous post) that i got.

LoneWolf
2nd April 2008, 01:16
Hi,

I dont have \ms in C:\psql\lib.
libpq.a is in C:\psql\lib.

janus
2nd April 2008, 08:03
Hi,

I dont have \ms in C:\psql\lib.
libpq.a is in C:\psql\lib.

But you installed the Postgres developer library as well?

Look at this thread.
http://www.qtcentre.org/forum/f-installation-and-deployment-5/t-problem-getting-qt-433-to-work-with-ms-visual-studio-2005-express-11252-post60433.html

Maybe you have to create a folder and copy the file there.

LoneWolf
2nd April 2008, 14:03
\ms is to msvc, isnt it?

I have mingw.

LoneWolf
3rd April 2008, 15:48
Does somebody have qt(+ mingw + psql) installed in Windows Vista here? If yes, it could make a step by step tutorial how install and integrate with psql using mingw in Vista.

LoneWolf
8th April 2008, 12:57
I got it!!! :)

I had to edit qtvars.bat. Put C:\psql\bin and C:\psql\lib.

Thanks everyone!!!

T0bi4s
4th November 2009, 14:22
Hi,
got again the same problem, the driver isn't loaded.
i created the dll with qmake -> no problem, i used the dll viewer to check which dlls are needed that the qpsql4 dll works copied them into the same directory but still my qt creator is not recognizing that the psql driver is installed.

i tried mabey that i was in the wrong dir, so i cut out the other dlls --> then qt creator said no drivers installed, i mean he said drivers avilable: .... and named non, so i guess it was cause i deleted them, when i put them back in he finds them, but

QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC and not my psql driver.

any1 got another idea?

tobi