Обсуждение: libpqxx
Hi Everyone, I have migrated to libpqxx which seems to fix up all the errors I was getting from libpq++. However, the class I implemented the database stuff in compiles fine, but as soon as I include that class in another class it gives me compiler errors from deep in libpqxx. Following is the some of the type of output I'm getting: In file included from DatabaseHandler.h:22, from Scheduler.h:32, from Scheduler.cpp:17: /usr/include/pqxx/connection.h:185: error: extraneous `int' ignored /usr/include/pqxx/connection.h:185: error: parse error before `)' token /usr/include/pqxx/connection.h: In member function `const char* pqxx::Connection::DbName() const': /usr/include/pqxx/connection.h:128: error: `m_Conn' undeclared (first use this function) /usr/include/pqxx/connection.h:128: error: (Each undeclared identifier is reported only once for each function it appears in.) /usr/include/pqxx/connection.h: In member function `const char* pqxx::Connection::Options() const': I assuming that it's a C/C++ compatibility problem, however I am so new to both languages, I am not sure. Has anyone come across this before? Any suggestions on how to fix it? Regards, Julie.
On Wed, Nov 12, 2003 at 05:25:05AM +1100, Julie Russell wrote: > > /usr/include/pqxx/connection.h:185: error: extraneous `int' ignored > /usr/include/pqxx/connection.h:185: error: parse error before `)' token Looks like you're using an outdated version... Have you looked at the 2.0 release? See http://pqxx.tk/ (slightly easier than looking it up at GBorg). Out of interest, which version were you using and where did you get it from? Because I don't recall ever seeing this problem before with 1.5.1, which has been the stable release for many months and is still fairly widely used AFAIK. Jeroen
Hi there, I downloaded libpqxx-2.0.0 from http://gborg.postgresql.org/project/libpqxx/download/download.php I implemented the code in class DatabaseHandler which compiles fine, but as soon as I #include "DatabaseHandler.h" in any other class, it pulls up compiler errors from libpqxx. I do have #ifdefs so the header shouldn't be included twice... Any ideas? Cheers, Julie. > -----Original Message----- > From: pgsql-interfaces-owner@postgresql.org > [mailto:pgsql-interfaces-owner@postgresql.org]On Behalf Of Jeroen T. > Vermeulen > Sent: Wednesday, 12 November 2003 5:43 AM > To: Julie Russell > Cc: pgsql-interfaces@postgresql.org > Subject: Re: [INTERFACES] libpqxx > > > *This message was transferred with a trial version of CommuniGate(tm) Pro* > On Wed, Nov 12, 2003 at 05:25:05AM +1100, Julie Russell wrote: > > > > /usr/include/pqxx/connection.h:185: error: extraneous `int' ignored > > /usr/include/pqxx/connection.h:185: error: parse error before `)' token > > Looks like you're using an outdated version... Have you looked at the > 2.0 release? See http://pqxx.tk/ (slightly easier than looking it up > at GBorg). > > Out of interest, which version were you using and where did you get it > from? Because I don't recall ever seeing this problem before with 1.5.1, > which has been the stable release for many months and is still fairly > widely used AFAIK. > > > Jeroen > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match > >
On Wed, Nov 12, 2003 at 09:42:28AM +1100, Julie Russell wrote: > > I downloaded libpqxx-2.0.0 from > http://gborg.postgresql.org/project/libpqxx/download/download.php That ought to be fine... Did you include <pqxx/connection> or the now deprecated <pqxx/connection.h>? (Note the notice at the top of the .h file). OTOH, I've still got the cursor and cachedresult in there which also compiles fine using the older .h headers! Oh, did you remember to run the configure script before building, like the README says? Are you running on a Unix-like system? > I implemented the code in class DatabaseHandler which compiles fine, but as > soon as I #include "DatabaseHandler.h" in any other class, it pulls up > compiler errors from libpqxx. I do have #ifdefs so the header shouldn't be > included twice... Any ideas? Shouldn't be needed. The header files without the .h or .hxx filename suffix will protect themselves against multiple inclusion. If there's no legal problem or anything like that, I'd like to take a look at your class and see if I can reproduce the problem. It'd also make the search a lot easier... I'd probably just need the headers and the exact sequence in which you include them. Right now I just haven't got a lot to go on! Jeroen