Unlike SqlLite, U++ support PostgreSql externally. PostgreSql's client interface source code is not included in U++. So your program compiles fine but when linking, it failed because undefined symbols.
To fix that, you should include the postgresql libary path in the link path. I remember somewhere in the manual it's taught on how to add library and library path.