ecpg -C INFORMIX - Mailing list pgsql-interfaces
From | Van Tress,Michael J - PGPW |
---|---|
Subject | ecpg -C INFORMIX |
Date | |
Msg-id | ABFD6FF32FFFB1418A736CE48257FE7112F7D6@EXHQVSB.bud.bpa.gov Whole thread Raw |
List | pgsql-interfaces |
<p><font face="Arial" size="2">I'm in the process of porting INFORMIX ESQL/C code to Postgres. </font><br /><font face="Arial"size="2">I've had great success until I've come upon Informix's datetime.h functions.</font><br /><font face="Arial"size="2">The code compiles, but when it comes time to link, I get the following error:</font><p><font face="Arial"size="2">gcc -L/usr/local/postgresql-8.0.3/lib -o temp_fcstPg temp_fcst.o timechar.o stresslib.o -lm -lpq -lecpg</font><br/><font face="Arial" size="2">temp_fcst.o: In function `main':</font><br /><font face="Arial" size="2">temp_fcst.o(.text+0x1fc):undefined reference to `dttoasc'</font><br /><font face="Arial" size="2">collect2: ld returned1 exit status</font><br /><font face="Arial" size="2">make: *** [temp_fcstPg] Error 1</font><br /><p><font face="Arial"size="2">dttoasc() is an INFORMIX ESQL/C datetime function.</font><br /><font face="Arial" size="2">I've usedthe -C INFORMIX option with ecpg. The output from the ecpg -C INFORMIX command seems to put the </font><br /><font face="Arial"size="2">appropriate header files into the program. Here is an example below:</font><br /><p><font face="Arial"size="2">#line 1 "/usr/local/postgresql-8.0.3/include/informix/esql/datetime.h"</font><br /><font face="Arial"size="2">#ifndef _ECPG_DATETIME_H</font><br /><font face="Arial" size="2">#define _ECPG_DATETIME_H</font><p><fontface="Arial" size="2">#include <ecpg_informix.h></font><p><font face="Arial" size="2">typedeftimestamp dtime_t;</font><br /><font face="Arial" size="2">typedef interval intrvl_t;</font><p><font face="Arial"size="2">#endif /* ndef _ECPG_DATETIME_H */</font><br /><p><font face="Arial" size="2">Looking at the contentsof the <ecpg_informix.h> file, it seems to declare the dttoasc() function.</font><p><font face="Arial" size="2">Myquestion ???</font><p><font face="Arial" size="2">Why is the program not linking? Is there a library I'm notincluding? Here is a copy of my Makefile:</font><br /><p><font face="Arial" size="2">PROGRAM = temp_fcstPg</font><br/><font face="Arial" size="2">CC1 = ecpg -C INFORMIX</font><br /><font face="Arial" size="2">CC2 = gcc -I/usr/local/postgresql-8.0.3/include -c</font><br /><font face="Arial" size="2">CC = gcc -L/usr/local/postgresql-8.0.3/lib-o</font><br /><font face="Arial" size="2">SRC = temp_fcst.c timechar.c stresslib.c</font><br/><font face="Arial" size="2">OBJ = temp_fcst.o timechar.o stresslib.o</font><br /><font face="Arial"size="2">LIB = -lm -lpq -lecpg</font><p><font face="Arial" size="2">all::temp_fcstPg</font><p><font face="Arial"size="2">temp_fcst.o: temp_fcst.pgc</font><br /><font face="Arial" size="2"> $(CC1) temp_fcst.pgc</font><br/><font face="Arial" size="2"> $(CC2) temp_fcst.c</font><p><font face="Arial" size="2">stresslib.o: stresslib.c</font><br /><font face="Arial" size="2"> $(CC2) stresslib.c</font><p><fontface="Arial" size="2">timechar.o: timechar.c</font><br /><font face="Arial" size="2"> $(CC2) timechar.c</font><p><font face="Arial" size="2">$(PROGRAM): $(OBJ)</font><br /><font face="Arial"size="2"> $(CC) $(PROGRAM) $(OBJ) $(LIB)</font><br /><p><font face="Arial" size="2">If anyone can pointme in the right direction, I would very much appreciate it!</font><p><font face="Arial" size="2">Thanks!</font><br />
pgsql-interfaces by date: