ecpg -C INFORMIX

From: "Van Tress,Michael J - PGPW" <mjvantress(at)bpa(dot)gov>
To: <pgsql-general(at)postgresql(dot)org>
Subject: ecpg -C INFORMIX
Date: 2005-09-09 21:18:07
Message-ID: ABFD6FF32FFFB1418A736CE48257FE7112F7D8@EXHQVSB.bud.bpa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm in the process of porting INFORMIX ESQL/C code to Postgres.
I've had great success until I've come upon Informix's datetime.h functions.
The code compiles, but when it comes time to link, I get the following error:

gcc -L/usr/local/postgresql-8.0.3/lib -o temp_fcstPg temp_fcst.o timechar.o stresslib.o -lm -lpq -lecpg
temp_fcst.o: In function `main':
temp_fcst.o(.text+0x1fc): undefined reference to `dttoasc'
collect2: ld returned 1 exit status
make: *** [temp_fcstPg] Error 1

dttoasc() is an INFORMIX ESQL/C datetime function.
I've used the -C INFORMIX option with ecpg. The output from the ecpg -C INFORMIX command seems to put the
appropriate header files into the program. Here is an example below:

#line 1 "/usr/local/postgresql-8.0.3/include/informix/esql/datetime.h"
#ifndef _ECPG_DATETIME_H
#define _ECPG_DATETIME_H

#include <ecpg_informix.h>

typedef timestamp dtime_t;
typedef interval intrvl_t;

#endif /* ndef _ECPG_DATETIME_H */

Looking at the contents of the <ecpg_informix.h> file, it seems to declare the dttoasc() function.

My question ???

Why is the program not linking? Is there a library I'm not including? Here is a copy of my Makefile:

PROGRAM = temp_fcstPg
CC1 = ecpg -C INFORMIX
CC2 = gcc -I/usr/local/postgresql-8.0.3/include -c
CC = gcc -L/usr/local/postgresql-8.0.3/lib -o
SRC = temp_fcst.c timechar.c stresslib.c
OBJ = temp_fcst.o timechar.o stresslib.o
LIB = -lm -lpq -lecpg

all::temp_fcstPg

temp_fcst.o: temp_fcst.pgc
$(CC1) temp_fcst.pgc
$(CC2) temp_fcst.c

stresslib.o: stresslib.c
$(CC2) stresslib.c

timechar.o: timechar.c
$(CC2) timechar.c

$(PROGRAM): $(OBJ)
$(CC) $(PROGRAM) $(OBJ) $(LIB)

If anyone can point me in the right direction, I would very much appreciate it!

Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bricklen Anderson 2005-09-09 21:35:07 ERROR: bogus varno
Previous Message stan 2005-09-09 21:03:18 FW: Can't connect to instance with pgaccess