Im using visual studio 2012 Ultimate and PostgreSQL 9.2 64 bit. I set up a completely new project with the following settings:
Additional includes folder: "C:\Program Files\PostgreSQL\9.2\include\"
Additional libs folder: "C:\Program Files\PostgreSQL\9.2\lib\"
Im linking against "libpq.lib".
My problem looks like that:
#include <iostream>
using namespace std;
#include <libpq-fe.h>
int main() {
PGconn *psql = PQconnectdb("hostaddr = '127.0.0.1' port = '' dbname = 'fwaggle' user = 'fwaggle' password = 'password' connect_timeout = '10'");
/* init connection */
if (!psql) {
}
std::cin.get();
return 0;
}
Result: "error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_PQconnectdb" in Funktion "_main". I cant get rid of this linker error, what am I doing wrong?