Thread: RE: Has anybody compiled .c file generated from .pgc file

RE: Has anybody compiled .c file generated from .pgc file

From
"Chandra Sekhar . K"
Date:
I am still getting same error message. I have installed
postgreSQL binaries on my NT machine under /usr/local/pgsql
( not under /usr/postgres ) directory. Does the directory
 structure matter for compilation ?

   I have include,lib directory structures under /usr/local/pgsql.

Thanks,
Chandra

At 11:08 AM 11/6/00 -0500, Riebs, Andy wrote:
>> I have been trying to run a sample code for postgreSQL
>> database.  I just want to create a database and do simple
>> insertion and extraction of the inserted data. I have
>> created .pgc file and am able to generate .c file using
>> ecpg but I am stuck with gcc , not able to create the
>> binary from .c file.
>
>Use a Makefile to specify the locations of the libraries,
>such as...
>
>-----snip-----
>SRCDIR=../postgres/src
>CFLAGS+=-I$(SRCDIR)/include
>CFLAGS+=-I$(SRCDIR)/interfaces/libpq
>CFLAGS+=-I$(SRCDIR)/interfaces/ecpg/include
>LIBPQDIR=$(SRCDIR)/interfaces/libpq
>LIBECPGDIR=$(SRCDIR)/interfaces/ecpg/lib
>LDFLAGS+=-L$(LIBPQDIR) -lpq
>LDFLAGS+=-L$(LIBECPGDIR) -lecpg
>LDFLAGS+=-g
>%.c : %.pgc
>       ecpg -t -o $@ $<
>-----snip-----
>
>/andy
>
>---
>Andy Riebs, andy.riebs@compaq.com    Alpha Technology Solutions Group
>978-506-6628, fax 978-506-6524       Compaq Computer Corporation
>(h) andy@freckles.mv.com            <http://www.linuxalpha.compaq.com>
>