Linking ECPG files to a C program - Mailing list pgsql-interfaces

From Jim Parker
Subject Linking ECPG files to a C program
Date
Msg-id 200203052308.g25N8OTW010944@smtp-server1.tampabay.rr.com
Whole thread Raw
List pgsql-interfaces
G'Day !

I have a very confusing problem.

I am trying to link files using a ECPG interface to a postgresql database
to a vector drawing program.

My test programs (when compiled by hand) work great, but when I use a
makefile to compile the modules and the regular C program, the linker gives
me undefined references to the ECPG routines.

I am using suffix rules in my Makefile as follows:

.pgc.c:ecpg -t $(PG_INC) $< $*.c

.c.o:$(CC) -c ($PG_INC) $(CFLAGS) $< -o $*.o

test_db: $(DB_OBJS) $(TEST_OBJS)$(CC) $(GTKLIB) $(LIBS) -o test_db $(DB_OBJS) $(TEST_OBJS)

Should I create a library to hold the ECPG routines ?  

Does anyone have any example code/Makefile I can look at ?

TIA

cheers,
Jim Parker



pgsql-interfaces by date:

Previous
From: hubert.palme@web.de (Hubert Palme)
Date:
Subject: Re: PL/pgSQL Syntax Problem
Next
From: "Jose Luis LG"
Date:
Subject: Re: Error passing parameter to functions