I think this is kind of offtopic, but google couldn't help and I don't know where else I could ask.

I'd like to write a postgresql client in c++ with libpqxx from the ports and can't get it to link.
(If I recall correctly, the libpqxx port is only used by koffice.)
I'm a little bit unexperienced with linking to other libraries, so it
could be something very obvious and a goto to a manual sufficiently helpful.
I'm running an approx. one week old snapshot on i386.

main.cpp:
#include <pqxx/pqxx>
int main(){
 pqxx::connection Conn("dbname=test");
 return 0;
}

and I tried to compile it with:
$ c++ -Wall -I /usr/local/include -L /usr/local/lib -o dbconntest main.cpp

and get this result:
/tmp//ccG13636.o(.text+0x2b): In function `main':
: undefined reference to `pqxx::connection::connection[in-charge](char const*)'
/tmp//ccG13636.o(.text+0x3d): In function `main':
: undefined reference to `pqxx::connection::~connection [in-charge]()'
collect2: ld returned 1 exit status
*** Error code 1

I also tried to link directly via -l with no success.

Any help would be appreciated - thank you.

Reply via email to