Re: Compiling pgsql C/C++ interfaces on Win not using Cygwin

From: "Crercio O(dot) Silva" <cos(at)dbtools(dot)com(dot)br>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Compiling pgsql C/C++ interfaces on Win not using Cygwin
Date: 2002-08-30 18:20:49
Message-ID: 000e01c25051$fb83b100$02c6a8c0@ntdevel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Tomás,

Include the lib in your project (Project => Settings =>Link Tab => Object
Library Modules). You have two options (for debug and release modes):

1) libpq.lib (static version, you don't need to distribute libpq.dll)
2) libpqdll.lib (dinamic link library, you need to distribute libpq.dll)

Also don't forget to set the directories under Tools => Options =>
Directories (Include Files and Library Files).
In the manual there are some info about compiling the libpq libraries in
Win32. I just don't remember where exactly.

PS: I'm assuming you are creating an application with VS6, since you
mentioned that.

[]s

Crercio O. Silva / DBTools Software

----- Original Message -----
From: "Tomáš Vondra" <vondra(at)tesmail(dot)cz>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Friday, August 30, 2002 11:22 AM
Subject: [GENERAL] Compiling pgsql C/C++ interfaces on Win not using Cygwin

> Hello everybody,
> is it possible to compile postgres C/C++ interfaces (use libpq or
> libpq++ in a client application) on Windows not using Cygwin?
>
> I've just tried to compile some examples from 7.2.1 using MS Visual
> C++ 6, but I got lot of "uresolved external symbol" errors when
> linking, for example:
>
> testlibpq2.obj : error LNK2001: unresolved external symbol _PQfinish
> testlibpq2.obj : error LNK2001: unresolved external symbol _PQnotifies
> testlibpq2.obj : error LNK2001: unresolved external symbol _PQclear
> testlibpq2.obj : error LNK2001: unresolved external symbol _PQresultStatus
> testlibpq2.obj : error LNK2001: unresolved external symbol _PQexec
> testlibpq2.obj : error LNK2001: unresolved external symbol _PQerrorMessage
> testlibpq2.obj : error LNK2001: unresolved external symbol _PQstatus
> testlibpq2.obj : error LNK2001: unresolved external symbol _PQsetdbLogin
>
> I think it means some important libraries are missing (at least I
> think it means this).
>
> I don't wan't to compile all the server, just the part necessarry
> to use in a client app. I don't want to use ODBC, I'd like to use
> native access to database. If there's such a way?
>
> Tomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bill 2002-08-30 18:54:42 Alter Table Error
Previous Message Bruce Momjian 2002-08-30 15:42:24 Re: Compiling pgsql C/C++ interfaces on Win not using Cygwin