Results 1 to 5 of 5

Thread: Error compiling psql plugin

  1. #1
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Exclamation Error compiling psql plugin

    System: debian etch.
    PostgreSQL client installed is 8.1.9 from synaptic

    I downloaded the PostgreSQL 8.2.5 source and tried to compile the plugin but it won't compile.
    Is it because the versions are different ?


    g++ -c -pipe -g -O2 -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_SHARED -I../../../../mkspecs/linux-g++ -I. -I../../../../include/QtCore -I../../../../include/QtCore -I../../../../include/QtSql -I../../../../include/QtSql -I../../../../include -I/usr/include/pgsql -I.moc/release-shared -I.uic/release-shared -o .obj/release-shared/qsql_psql.o ../../../sql/drivers/psql/qsql_psql.cpp
    ../../../sql/drivers/psql/qsql_psql.cpp:37:22: error: libpq-fe.h: No such file or directory
    ../../../sql/drivers/psql/qsql_psql.cpp: In function ‘QSqlError qMakeError(const QString&, QSqlError::ErrorType, const QPSQLDriverPrivate*)’:
    ../../../sql/drivers/psql/qsql_psql.cpp:127: error: ‘PQerrorMessage’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘bool QPSQLResultPrivate:rocessResults()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:137: error: ‘PQresultStatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:138: error: ‘PGRES_TUPLES_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:141: error: ‘PQntuples’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:143: error: ‘PGRES_COMMAND_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘void QPSQLResult::cleanup()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:221: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual bool QPSQLResult::fetchLast()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:249: error: ‘PQntuples’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual QVariant QPSQLResult::data(int)’:
    ../../../sql/drivers/psql/qsql_psql.cpp:254: error: ‘PQnfields’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:258: error: ‘PQftype’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:260: error: ‘PQgetvalue’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:261: error: ‘PQgetisnull’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:323: error: ‘PQunescapeBytea’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual bool QPSQLResult::isNull(int)’:
    ../../../sql/drivers/psql/qsql_psql.cpp:337: error: ‘PQgetvalue’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:338: error: ‘PQgetisnull’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual bool QPSQLResult::reset(const QString&)’:
    ../../../sql/drivers/psql/qsql_psql.cpp:350: error: ‘PQexec’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual int QPSQLResult::numRowsAffected()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:361: error: ‘PQcmdTuples’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual QVariant QPSQLResult::lastInsertId() const’:
    ../../../sql/drivers/psql/qsql_psql.cpp:367: error: ‘Oid’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:367: error: expected `;' before ‘id’
    ../../../sql/drivers/psql/qsql_psql.cpp:368: error: ‘id’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:368: error: ‘InvalidOid’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual QSqlRecord QPSQLResult::record() const’:
    ../../../sql/drivers/psql/qsql_psql.cpp:380: error: ‘PQnfields’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:384: error: ‘PQfname’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:386: error: ‘PQfname’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:387: error: ‘PQftype’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:388: error: ‘PQfsize’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:389: error: ‘PQfmod’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In function ‘bool setEncodingUtf8(PGconn*)’:
    ../../../sql/drivers/psql/qsql_psql.cpp:407: error: ‘PQexec’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:408: error: ‘PQresultStatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:409: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:410: error: ‘PGRES_COMMAND_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In function ‘void setDatestyle(PGconn*)’:
    ../../../sql/drivers/psql/qsql_psql.cpp:415: error: ‘PQexec’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:416: error: ‘PQresultStatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:417: error: ‘PGRES_COMMAND_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:418: error: ‘PQerrorMessage’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:419: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In function ‘QPSQLDriver::Protocol getPSQLVersion(PGconn*)’:
    ../../../sql/drivers/psql/qsql_psql.cpp:424: error: ‘PQexec’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:425: error: ‘PQresultStatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:426: error: ‘PGRES_COMMAND_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:426: error: ‘PGRES_TUPLES_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:427: error: ‘PQgetvalue’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:428: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In destructor ‘virtual QPSQLDriver::~QPSQLDriver()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:481: error: ‘PQfinish’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual bool QPSQLDriver:pen(const QString&, const QString&, const QString&, const QString&, int, const QString&)’:
    ../../../sql/drivers/psql/qsql_psql.cpp:554: error: ‘PQconnectdb’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:555: error: ‘PQstatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:555: error: ‘CONNECTION_BAD’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:556: error: ‘PQfinish’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual void QPSQLDriver::close()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:576: error: ‘PQfinish’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual bool QPSQLDriver::beginTransaction()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:594: error: ‘PQexec’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:595: error: ‘PQresultStatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:595: error: ‘PGRES_COMMAND_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:596: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:601: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual bool QPSQLDriver::commitTransaction()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:611: error: ‘PQexec’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:612: error: ‘PQresultStatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:612: error: ‘PGRES_COMMAND_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:613: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:618: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual bool QPSQLDriver::rollbackTransaction()’:
    ../../../sql/drivers/psql/qsql_psql.cpp:628: error: ‘PQexec’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:629: error: ‘PQresultStatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:629: error: ‘PGRES_COMMAND_OK’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:632: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:635: error: ‘PQclear’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual QString QPSQLDriver::formatValue(const QSqlField&, bool) const’:
    ../../../sql/drivers/psql/qsql_psql.cpp:900: error: ‘PQescapeBytea’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp: In member function ‘virtual bool QPSQLDriver::isOpen() const’:
    ../../../sql/drivers/psql/qsql_psql.cpp:926: error: ‘PQstatus’ was not declared in this scope
    ../../../sql/drivers/psql/qsql_psql.cpp:926: error: ‘CONNECTION_OK’ was not declared in this scope
    make: *** [.obj/release-shared/qsql_psql.o] Error 1

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error compiling psql plugin

    Do you have libpq-fe.h header somewhere on your system? Maybe you have to install some additional package like postgresql-devel?

  3. #3
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Error compiling psql plugin

    yes: /usr/include/postgresql/libpq-fe.h
    libpq-dev is installed, I also tried to compile with
    make -I /usr/include/postgresql/
    Last edited by vieraci; 6th October 2007 at 02:58.

  4. #4
    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: Error compiling psql plugin

    You have to pass the include path to qmake already. Can you show us the qmake line you tried using to compile the postgres plugin?
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  5. The following user says thank you to Methedrine for this useful post:

    vieraci (7th October 2007)

  6. #5
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Error compiling psql plugin

    OK, I see where I went wrong,
    qmake -o Makefile "INCLUDEPATH+=/usr/include/pgsql" "LIBS+=-L/usr/lib -lpq" psql.pro
    My INCLUDEPATH was invalid.
    Thanks,

Similar Threads

  1. Need help making plugin
    By vieraci in forum Qt Programming
    Replies: 10
    Last Post: 24th September 2007, 14:20
  2. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 15:13
  3. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 20:05
  4. Qt4 win opensource + mysql plugin
    By vr in forum Installation and Deployment
    Replies: 3
    Last Post: 25th May 2007, 10:01

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.