Version: 1.3_beta3 (using KDE KDE 3.4.2) Installed from: Gentoo Packages Compiler: gcc-3.4.4 OS: Linux Hi, because I have a postgresql database installed I want amarok to use this. But when I compile it with postgres support enabled I get the following compile error: i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../amarok/src/amarokcore -I../../amarok/src/amarokcore -I../../amarok/src/analyzers -I../../amarok/src/engine -I../../amarok/src/plugin -I../../amarok/src/statusbar -I/usr/kde/3.4/include/arts -I/usr/include/taglib -I../../amarok/src/sqlite -I/usr/include -I/usr/kde/3.4/include -I/usr/qt/3/include -I. -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -march=i686 -mtune=pentium4m -Os -pipe -fomit-frame-pointer -fvisibility-inlines-hidden -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -c -o collectiondb.o collectiondb.cpp collectiondb.cpp:60:39: postgresql/pgsql/libpq-fe.h: Datei oder Verzeichnis nicht gefunden collectiondb.cpp: In constructor `PostgresqlConnection::PostgresqlConnection(PostgresqlConfig*)': collectiondb.cpp:2252: Fehler: »PQconnectdb« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2252: Fehler: (Jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet.) collectiondb.cpp:2255: Fehler: »PQerrorMessage« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2261: Fehler: »PQstatus« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2261: Fehler: »CONNECTION_OK« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2266: Fehler: »PQfinish« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp: In destructor `virtual PostgresqlConnection::~PostgresqlConnection()': collectiondb.cpp:2278: Fehler: »PQfinish« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp: In member function `virtual QStringList PostgresqlConnection::query(const QString&)': collectiondb.cpp:2285: Fehler: »PGresult« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2285: Fehler: »result« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2286: Fehler: »ExecStatusType« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2286: Fehler: expected `;' vor "status" collectiondb.cpp:2288: Fehler: »PQexec« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2291: Fehler: »PQerrorMessage« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2295: Fehler: »status« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2295: Fehler: »PQresultStatus« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2296: Fehler: »PGRES_COMMAND_OK« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2296: Fehler: »PGRES_TUPLES_OK« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2299: Fehler: »PQclear« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2303: Fehler: »PQnfields« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2304: Fehler: »PQntuples« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2307: Fehler: »PQfname« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2319: Fehler: »PQgetvalue« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp: In member function `virtual int PostgresqlConnection::insert(const QString&, const QString&)': collectiondb.cpp:2331: Fehler: »PGresult« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2331: Fehler: »result« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2332: Fehler: »ExecStatusType« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2332: Fehler: expected `;' vor "status" collectiondb.cpp:2336: Fehler: »PQexec« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2339: Fehler: »PQerrorMessage« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2343: Fehler: »status« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2343: Fehler: »PQresultStatus« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2344: Fehler: »PGRES_COMMAND_OK« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2347: Fehler: »PQclear« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2366: Fehler: »PGRES_TUPLES_OK« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2373: Fehler: »PQnfields« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2373: Fehler: »PQntuples« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp:2380: Fehler: »PQgetvalue« nicht deklariert (erste Verwendung dieser Funktion) collectiondb.cpp: In member function `void PostgresqlConnection::setPostgresqlError()': collectiondb.cpp:2389: Fehler: »PQerrorMessage« nicht deklariert (erste Verwendung dieser Funktion) make[4]: *** [collectiondb.o] Fehler 1 make[4]: *** Warte auf noch nicht beendete Prozesse... make[4]: Leaving directory `/var/tmp/portage/amarok-1.3_beta3/work/amarok-1.3-beta3/amarok/src' make[3]: *** [all-recursive] Fehler 1 make[3]: Leaving directory `/var/tmp/portage/amarok-1.3_beta3/work/amarok-1.3-beta3/amarok/src' make[2]: *** [all-recursive] Fehler 1 make[2]: Leaving directory `/var/tmp/portage/amarok-1.3_beta3/work/amarok-1.3-beta3/amarok' make[1]: *** [all-recursive] Fehler 1 make[1]: Leaving directory `/var/tmp/portage/amarok-1.3_beta3/work/amarok-1.3-beta3' make: *** [all] Fehler 2 Regards, Tassilo
Oh, sorry. I should have included a nonlocalized error message, so here it is: i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../amarok/src/amarokcore -I../../amarok/src/amarokcore -I../../amarok/src/analyzers -I../../amarok/src/engine -I../../amarok/src/plugin -I../../amarok/src/statusbar -I/usr/kde/3.4/include/arts -I/usr/include/taglib -I../../amarok/src/sqlite -I/usr/include -I/usr/kde/3.4/include -I/usr/qt/3/include -I. -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -march=i686 -mtune=pentium4m -Os -pipe -fomit-frame-pointer -fvisibility-inlines-hidden -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -c -o collectiondb.o collectiondb.cpp collectiondb.cpp:60:39: postgresql/pgsql/libpq-fe.h: No such file or directory collectiondb.cpp: In constructor `PostgresqlConnection::PostgresqlConnection(PostgresqlConfig*)': collectiondb.cpp:2252: error: `PQconnectdb' undeclared (first use this function) collectiondb.cpp:2252: error: (Each undeclared identifier is reported only once for each function it appears in.) collectiondb.cpp:2255: error: `PQerrorMessage' undeclared (first use this function) collectiondb.cpp:2261: error: `PQstatus' undeclared (first use this function) collectiondb.cpp:2261: error: `CONNECTION_OK' undeclared (first use this function) collectiondb.cpp:2266: error: `PQfinish' undeclared (first use this function) collectiondb.cpp: In destructor `virtual PostgresqlConnection::~PostgresqlConnection()': collectiondb.cpp:2278: error: `PQfinish' undeclared (first use this function) collectiondb.cpp: In member function `virtual QStringList PostgresqlConnection::query(const QString&)': collectiondb.cpp:2285: error: `PGresult' undeclared (first use this function) collectiondb.cpp:2285: error: `result' undeclared (first use this function) collectiondb.cpp:2286: error: `ExecStatusType' undeclared (first use this function) collectiondb.cpp:2286: error: expected `;' before "status" collectiondb.cpp:2288: error: `PQexec' undeclared (first use this function) collectiondb.cpp:2291: error: `PQerrorMessage' undeclared (first use this function) collectiondb.cpp:2295: error: `status' undeclared (first use this function) collectiondb.cpp:2295: error: `PQresultStatus' undeclared (first use this function) collectiondb.cpp:2296: error: `PGRES_COMMAND_OK' undeclared (first use this function) collectiondb.cpp:2296: error: `PGRES_TUPLES_OK' undeclared (first use this function) collectiondb.cpp:2299: error: `PQclear' undeclared (first use this function) collectiondb.cpp:2303: error: `PQnfields' undeclared (first use this function) collectiondb.cpp:2304: error: `PQntuples' undeclared (first use this function) collectiondb.cpp:2307: error: `PQfname' undeclared (first use this function) collectiondb.cpp:2319: error: `PQgetvalue' undeclared (first use this function) collectiondb.cpp: In member function `virtual int PostgresqlConnection::insert(const QString&, const QString&)': collectiondb.cpp:2331: error: `PGresult' undeclared (first use this function) collectiondb.cpp:2331: error: `result' undeclared (first use this function) collectiondb.cpp:2332: error: `ExecStatusType' undeclared (first use this function) collectiondb.cpp:2332: error: expected `;' before "status" collectiondb.cpp:2336: error: `PQexec' undeclared (first use this function) collectiondb.cpp:2339: error: `PQerrorMessage' undeclared (first use this function) collectiondb.cpp:2343: error: `status' undeclared (first use this function) collectiondb.cpp:2343: error: `PQresultStatus' undeclared (first use this function) collectiondb.cpp:2344: error: `PGRES_COMMAND_OK' undeclared (first use this function) collectiondb.cpp:2347: error: `PQclear' undeclared (first use this function) collectiondb.cpp:2366: error: `PGRES_TUPLES_OK' undeclared (first use this function) collectiondb.cpp:2373: error: `PQnfields' undeclared (first use this function) collectiondb.cpp:2373: error: `PQntuples' undeclared (first use this function) collectiondb.cpp:2380: error: `PQgetvalue' undeclared (first use this function) collectiondb.cpp: In member function `void PostgresqlConnection::setPostgresqlError()': collectiondb.cpp:2389: error: `PQerrorMessage' undeclared (first use this function) make[4]: *** [collectiondb.o] Error 1 make[4]: *** Waiting for unfinished jobs.... Regards, Tassilo
It's failing to include libpq-fe.h : collectiondb.cpp:60:39: postgresql/pgsql/libpq-fe.h: No such file or directory Where is this file on your system? There's some problem on the way we're detecting this, it seems, but I can't test.
root@inspiron> locate libpq-fe.h /usr/include/postgresql/libpq-4/libpq-fe.h /usr/include/postgresql/libpq-fe.h /usr/include/libpq-fe.h The last 2 are symlinks to the first location.
I think you need a /usr/include/postgresql/pgsql/libpq-fe.h are you using the newest postgresql?
What does the command pg_config --includedir returns? And does it work if you just change #include <postgresql/pgsql/libpq-fe.h> into #include <libpq-fe.h> in your amarok sources, src/collectiondb.cpp (line 60) ?
I just installed postgresql 8.0.1 and /usr/include/postgresql/pgsql/libpq-fe.h installed. So amaroK compiled fine with postgresql support. I'm inclined to think Tassilo is using an older version of Postgresql. Could you confirm? Just run the command `pg_config --version`. Perhaps we need to change the configure check.
root@inspiron> pg_config --version PostgreSQL 8.0.3 root@inspiron> pg_config --includedir /usr/include Now I'm trying to compile amarok with the changed include Alexandre proposed... (This could take some time.)
With Alexandre's change I was able to build it. Thanks a lot!
Well, that change fixes things for you, but would break it for other people. Reopening the bug until we find a reliable way of including these libs.
Yes, this is a bug report, not a tech support ticket. I actually have identical but seperate /usr/include/libpq-fe.h and /usr/include/postgresql/pgsql/libpq-fe.h files. So this change would work for me.
Tassilo: Unless you're sure you found a kde bug, please use bugs.g.o. We may forward you here, but we like to check before. To clear things up a bit. libpq-8.0.1 installs /usr/include/postgresql/libpq-3/libpq-fe.h libpq-8.0.3 installs /usr/include/postgresql/libpq-4/libpq-fe.h The latter links to /usr/include/libpq-fe.h and /usr/include/postgresql/libpq-fe.h on my box. Yes - both versions are installed. I guess our postgres team wants to support two different apis. It would be great, if you'd support /usr/include/postgresql/libpq-<x> paths, otherwise we'll need to patch.
Carsten: No this doesn't clear things up, quite the contrary. I was about to commit the fix. What exactly is the problem with #include <libpq-fe.h> ? http://www.postgresql.org/docs/current/static/libpq-build.html seems to indicate that it is correct. I use Gentoo and postgresql 8.0.1 and don't have /usr/include/postgresql/libpq-fe.h. I'd guess your pg_config --includedir would return either /usr/include/postgresql or /usr/include/postgresql/libpq-4/ so everything would be hunky-dory. How does one program have so many different variations of headers. :|
Ah sorry Ian, I did not look into this and thougt you've to test hardcoded paths for the postgres includes. The bug here is clearly invalid. pg_config --includedir returns /usr/include, so this is clearly a Gentoo bug. > How does one program have so many different variations of headers. :| I do not even understand the symlinks. I'd rather fix broken scripts to use pg_config. And I don't know why libpq is slotted. There are no other ebuilds than postgresql - which isn't slotted - itself depending on the exact versions. No idea what was the intention, but it looks broken to me. Weird.
Ok, well I've gone ahead and made the fix since it is in line with what the postgresql documentation says to do anyways.