[Libpqxx-general] Creating a connection object

Jeroen Vermeulen jtv at xs4all.nl
Thu Jun 12 20:11:35 UTC 2008


Vincent Predoehl wrote:
> I'm want to use libpqxx integration in my app.  The tutorial says to 
> create a connection using:
> 
> connection Conn("dbname=test");
> 
> The correct header to use appears to be #include <pqxx/connection>, but 
> I get this compile error:
> 
> /usr/local/include/pqxx/basic_connection.hxx:45: error: redefinition of 
> 'class pqxx::basic_connection<CONNECTPOLICY>'
> /usr/local/include/pqxx/basic_connection.hxx:47: error: previous 
> definition of 'class pqxx::basic_connection<CONNECTPOLICY>'

That line above is supposed to work.  Did you configure and build 
libpqxx yourself, or did you use a packaged version for your platform? 
Also, what libpqxx and gcc version are you using?  (The errors look like 
gcc ones, so I'm assuming that's what you use).


Jeroen



More information about the Libpqxx-general mailing list