Pick a database and table that exists, configure the string cconstants, compile and run the attached cpp, get 0 instead of 1 (that you get in pgAdmin...
Where's can I download the libpq source? Maybe I can find and/or fix the problem myself.