I quickly checked out some of the postgre headers I'm flying over, and they don't seem to end up extern "C"compiling with the C ++ compiler. Is it possible that your problem will be solved by including include statements for postgre headers in the block extern "C" { ... }?
.
, : libpq.a and libmylib.a. , . -lpq gcc, . -L, . , . , . , , . apt-get, , , ( ldd /usr/lib/libpq.so). , , , -lpq -lMYLIB , libpq.