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

ecpg -C INFORMIX

From: "Van Tress,Michael J - PGPW" <mjvantress(at)bpa(dot)gov>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: ecpg -C INFORMIX
Date: 2005-09-09 20:56:37
Message-ID: ABFD6FF32FFFB1418A736CE48257FE7112F7D6@EXHQVSB.bud.bpa.gov (view raw or flat)
Thread:
Lists: pgsql-interfaces
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-interfaces by date

Next:From: Peter ManchevDate: 2005-09-10 14:54:39
Subject: Oracle ADF Faces with PostgreSQL ?
Previous:From: Mischa SandbergDate: 2005-09-09 20:44:33
Subject: Change of default type in DBD::Pg 1.42

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