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

Using libpq - C Library with borland compiler under Windows

From: tszp(at)op(dot)pl
To: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Using libpq - C Library with borland compiler under Windows
Date: 2005-07-21 10:40:47
Message-ID: 20050721104053Z1271482-6090+352@kps6.test.onet.pl (view raw or flat)
Thread:
Lists: pgsql-hackers-win32
Hi everybody,

I would like to write a program in C processing some data stored in PostgreSQL 8.0 by using the libq under Windows.
Thus I installed the PostgreSQL 8.03 and a free compiler Borland 5.5 C++ compiler .

Now I would like to see if the test program from PostgreSQL named testlibpq.c works.

So I copied from the necessary header files 
from  c:\Program Files\PostgreSQL\8.0\include to c:\Borland\BCC55\Include and
the necessary Lib file(s)
from  c:\Program Files\PostgreSQL\8.0\lib\ms\libpq.lib to c:\Borland\BCC55\Lib

And tried to compile the test program, but always got a message:
Unresolved external ...

Can somebody [knowing Borland C++ compiler] help me in this matter?


If I issue this
C:\Borland\BCC55\Bin>bcc32 testlibpq.c
or this:
C:\Borland\BCC55\Bin>bcc32 -Lc:\borland\bcc55\lib\libpq.lib testlibpq.c
I always get:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
testlibpq.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_PQconnectdb' referenced from C:\BORLAND\BCC55\BIN\T
ESTLIBPQ.OBJ
Error: Unresolved external '_PQstatus' referenced from C:\BORLAND\BCC55\BIN\TEST
LIBPQ.OBJ
Error: Unresolved external '_PQresultStatus' referenced from C:\BORLAND\BCC55\BI
N\TESTLIBPQ.OBJ
Error: Unresolved external '_PQerrorMessage' referenced from C:\BORLAND\BCC55\BI
N\TESTLIBPQ.OBJ
Error: Unresolved external '_PQnfields' referenced from C:\BORLAND\BCC55\BIN\TES
TLIBPQ.OBJ
Error: Unresolved external '_PQfname' referenced from C:\BORLAND\BCC55\BIN\TESTL
IBPQ.OBJ
Error: Unresolved external '_PQgetvalue' referenced from C:\BORLAND\BCC55\BIN\TE
STLIBPQ.OBJ
Error: Unresolved external '_PQntuples' referenced from C:\BORLAND\BCC55\BIN\TES
TLIBPQ.OBJ
Error: Unresolved external '_PQexec' referenced from C:\BORLAND\BCC55\BIN\TESTLI
BPQ.OBJ
Error: Unresolved external '_PQclear' referenced from C:\BORLAND\BCC55\BIN\TESTL
IBPQ.OBJ
Error: Unresolved external '_PQfinish' referenced from C:\BORLAND\BCC55\BIN\TEST
LIBPQ.OBJ

C:\Borland\BCC55\Bin>

Attached Borland config files:


Kind regards,

Tomek


Attachment: ilink32.cfg
Description: application/octet-stream (37 bytes)
Attachment: bcc32.cfg
Description: application/octet-stream (66 bytes)

pgsql-hackers-win32 by date

Next:From: Magnus HaganderDate: 2005-07-22 07:29:16
Subject: Re: 1) Error event produced during 8.0.3 shutdown. 2) Likely wrong interruption time reported in log files (8.0.0 and 8.0.3).
Previous:From: Jason LongDate: 2005-07-20 16:36:42
Subject: Re: Manual installation of PostgreSQL 8

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