Re: Question on mixing ESQL/C and C++
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
In article <1995Aug24.030536.16621@lmpsbbs.comm.mot.com>, ennis@rastov10.comm.mot.com (Bill Ennis) wrote: > Hi, > > Does anyone out there have experience mixing ESQl/C and C++? > The only instruction that I have is an old tech bulletin from Informix. > I am running Online version 7.10 with ESQL version 7.1. > > The tech bulletin says something about creating a header file with > all of the Informix library functions declared as prototypes. I tried > this and keep geetting symbol refernce errors. See below. > > If anyone can shed some light on this I would really appreaciate it! > > Thanks, > Bill > ------------------- > Undefined first referenced > symbol in file > _iqnprep(char*, char*) guif_table.o > sqlca guif_table.o <snip> We are using ESQL/C with C++ quite successfully. It's certainly much easier to do with Informix 7.1 than with 5.04! Your problem appears to be in the linking stage, not the compiling stage. To link ESQL/C with C++, you need to set the INFORMIXC environment variable to CC, so that the C++ compiler is permitted to invoke the linker. You should then modify your Makefile to link using esql, not CC. (esql will invoke CC for you once the INFORMIXC environment variable is set.) This, of course, assumes that you're using Informix on Unix, and that you are using a Makefile... Just a note to the Informix folks: The tech bulletin Bill refers to is nice for embedding ESQL into C++, but it doesn't address the issue of *linking* ESQL/C with C++. Might be worth updating the tech bulletin. -- Jonathan Crawford Ark Technologies, Inc.