esql 7.20 problem
Posted in 1997
Topics: High Availability & Replication, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
I must be missing something here. I have been using esqlc with C++ for 6 months now under 5.08 and Solaris. Now we are heading to 7.20. So, I begin porting my code. I need to remove the useful header files posted to the repository by J. Loeffler. No problem. I run esql against my .ec file, I move the .c file to .C. I compile the file using the C++ compiler. I link using esql. I get undefined routines in the informix c library. Whoops, looks like those have been declared with c (not C++) linkage. Better check the generated code. Well, what have we here, gratuitously added to the top of each and every generated file: #include <sqlhdr.h> #include <sqlca.h> < and some other cruft > Sweet. these files force c declarations down my throat. OK, well, I can sed that stuff out. Let's try compiling the hand-tweaked code and see what happens. Darn, now the dtime_t structure is undefined. Well, lets add the datetime include file and try it again. Arghh! that file declares the date time routines with c linkage (again). Now what? Do I have to build my own include files which not only declare the external routines with "C" linkage AND put in the data structures? Say it aint so...... Here's an example: int main(void) { dtime_t dt; short t[3]; $long Today; dtcurrent(&dt); rtoday(&Today); printf("Today = %d\\n",Today); t[0] = 5; t[1] = 29; t[2] = 1997; Today = -1; (void) rmdyjul(t,&Today); printf("yesterday = %d\\n",Today); } To build: 1) esql -e atest.ec 2) mv atest.c atest.C 3) gcc or (CC) -I$INFORMIXDIR/incl/esql -c datest.C 4) esql datest.o and it dont work!! Please tell me what I have missed here, I couldnt find any online documentation about this. I refuse to go back to C, in fact I cant. TIA, tom dorgan.