ecpg -C INFORMIX - Mailing list pgsql-general

From Van Tress,Michael J - PGPW
Subject ecpg -C INFORMIX
Date
Msg-id ABFD6FF32FFFB1418A736CE48257FE7112F7D8@EXHQVSB.bud.bpa.gov
Whole thread Raw
Responses Re: ecpg -C INFORMIX
List 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!

pgsql-general by date:

Previous
From: Douglas McNaught
Date:
Subject: Re: Can't connect to instance with pgaccess
Next
From: Bricklen Anderson
Date:
Subject: ERROR: bogus varno