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

Linking ECPG files to a C program

From: Jim Parker <hparker(at)fit(dot)edu>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Linking ECPG files to a C program
Date: 2002-03-05 23:08:22
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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:

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

	$(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 ?


Jim Parker


pgsql-interfaces by date

Next:From: Jose Luis LGDate: 2002-03-06 09:32:08
Subject: Re: Error passing parameter to functions
Previous:From: Hubert PalmeDate: 2002-03-05 20:33:44
Subject: Re: PL/pgSQL Syntax Problem

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