PDA

View Full Version : g++ compile using postgresql library



bo01
January 30th, 2009, 01:32 AM
Hi guys,
just another question about postgres-c++.

Does anyone know the exact command (flags etc) for g++ in order to compile and link the libraries of Postgres (libpqxx)? I want to use the c++ library (libpqxx), not the c one (libq-fe.h).

Thanks in advance

bo01
January 30th, 2009, 01:49 AM
Ok, I think I found it.

For those who has the same question the option in g++ is -lpqxx.

So, the command looks like this:


g++ -o output_file.o source_file.o -lpq -lpqxx