Re: C++ with ESQL/C
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
We use C++ and ESQL/C all of the time with 4.0, 5.0 and 6.0. There are a few tricks. 1. We created an INFORMIXDIR/bin/esql+ script that replaced the call to cc with CC 2. We only use esql+ to to generate the .o files, all linking is done on a link line in our Makefiles. 3. You have to get ANSI fucntion prototypes for the functions that ESQL needs. This was a problem in 4.0 and 5.0 since they didn't come with prototypes. 6.0 does. We got the 4.0 and 5.0 ones off of the net -- at emory.edu I think. 4. Don't forget to wrap extern "C" around the function prototypes to prevent the C++ name mangeling from getting in the way. Informix doesn't do this 6.0 (4.0 and 5.0 don't even have the protypes). 6. Be careful with cursors since they are (or were) declared static with fixed names, this was not very good if you had multiple queries going on. There may be some other things that I have forgotten, but this should get you started. Doug Griswold dbg@sur1a.hpsc.hisd.harris.com Lead Software Engineer Harris Publishing Systems