Skip site navigation (1) Skip section navigation (2)

Windows 7 64 bit, Postgres 9 64 bit, MS C++ Express Linker error

From: shy guy <shy_guy_001(at)hotmail(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Windows 7 64 bit, Postgres 9 64 bit, MS C++ Express Linker error
Date: 2011-11-12 02:19:43
Message-ID: BAY146-W49DA1DB0A56A196A9D5850F7C20@phx.gbl (view raw or flat)
Thread:
Lists: 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 _wmain1>C:\Users\kim\Documents\Visual Studio 2008\Projects\postgres_connection_test\Debug\postgres_connection_test.exe : fatal error LNK1120: 1 unresolved externals1>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)
 		 	   		  

Responses

pgsql-novice by date

Next:From: Roy's EmailDate: 2011-11-12 21:11:59
Subject: Re: Windows 7 64 bit, Postgres 9 64 bit, MS C++ Express Linker error
Previous:From: Craig BarnesDate: 2011-11-09 21:37:37
Subject: Re: column does not exist Error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group