Windows 7 64 bit, Postgres 9 64 bit, MS C++ Express Linker error - Mailing list pgsql-novice

From shy guy
Subject Windows 7 64 bit, Postgres 9 64 bit, MS C++ Express Linker error
Date
Msg-id BAY146-W49DA1DB0A56A196A9D5850F7C20@phx.gbl
Whole thread Raw
Responses Re: Windows 7 64 bit, Postgres 9 64 bit, MS C++ Express Linker error  (Roy's Email <rmw256@hotmail.com>)
List pgsql-novice
Hi,

Im having link problems and need help.

I have:
Windows 7 64 bit
installed postgresql-9.0.5-1-windows-x62.exe
installed Visual c++ 2008 Express Edition
set c/c++->additional Include Directories (seems to be ok as it compiles if I remove the PGconn and conn lines from the program and only have the libpq-fe.h header.
        set Linker->General->Additional Library Directories
        set Linker->Input->Additional Dependencies (libpq.lib)

Previous on a different older laptop:
       Windows XP
       Postgress 8.4 and 9.1 installed
       Visual c++ 2008 Express Edition
       Same program and settings and it compiled ok against 8.4 and 9.1
       Also had Eclipse with MinGW and it compiled ok against 8.4 and 9.1

So I dont know what I'm doing wrong ... and Im sure its something stupid buts its driving me crazy.
I saw a similar post by "Roy's Email" but there were no responses. :(
Roy, did you fix your problem?

Thanks,
Kim
==================================================================================
#include "stdafx.h"
#include <iostream>
#include <libpq-fe.h>

int _tmain(int argc, _TCHAR* argv[])
{
PGconn *conn = NULL;

conn = PQconnectdb("user=postgres password=test123 dbname=testdb hostaddr=127.0.0.1 port=5432");

return 0;
}

1>Linking...
1>postgres_connection_test.obj : error LNK2019: unresolved external symbol _PQconnectdb referenced in function _wmain
1>C:\Users\kim\Documents\Visual Studio 2008\Projects\postgres_connection_test\Debug\postgres_connection_test.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\kim\Documents\Visual Studio 2008\Projects\postgres_connection_test\postgres_connection_test\Debug\BuildLog.htm"
1>postgres_connection_test - 2 error(s), 0 warning(s)

pgsql-novice by date:

Previous
From: piotr
Date:
Subject: Linux Mint 10 (julia): starting Postrgesql 8.4 at booting up
Next
From: Roy's Email
Date:
Subject: Re: Windows 7 64 bit, Postgres 9 64 bit, MS C++ Express Linker error