Re: 4GL on HPUX: compile problems
Posted in 1998
David Coburn wrote: > > Howdy. I'm migrating lots of 4GL code from an old Sequent/Unisys machine > with 4GL 4.x to HPUX 10.20 and 4GL 6.x (sorry, no exact version numbers > right now, but these should be close enough). Everything is fine until I > get to one section of code that has embedded ESQL/C code in it. The > problem is that when compiled and run I get a -404 error, or "Statement not > available." (The error indicates that the statement has been previously > freed in the code. This is (a) not true because the preceeding two > statements did the declare and prepare; and (b) the cursor name is unique > in the source, so I don't think it is getting confused with an earlier > cursor name.) > > Tech support suggests that I'm running the wrong version of ESQL/C (7.10 or > so) for the 4GL; given the disparity in version numbers I don't find this > hard to believe. > > Their suggestion was to use the 4GL compiler to compile the ESQL/C, but > when I try this the preprocessor refuses to include my standard Informix > header, sqlca.h. I have made sure that the path for Informix include files > is in the c4gl command (by adding -I$(INFORMIXDIR)/incl to the c4gl compile > statement but it appears to ignore the directive. (Indeed, in reading the > c4gl script I find that -I is ignored instead of being passed on.) > > Things are getting a tad desparate. Has anybody else seen this? Support > says they've never heard about this problem before. As hard as that is to > believe, I do think it entirely likely that the engineer I spoke with > simply couldn't find the problem. 4GL now mangles cursor names under the hood so that they are local to a function to make it easier to write library code. Try passing the '-globcurs' flag to c4gl for each 4GL module that has to share its cursor names with either 4GL or C functions in another file. The new 4GL library also supplies the function CURSORNAME() function to which you pass the source cursor name and which returns the mangled name. You may be able to pass the mangled name to the esql/c function to use in a host variable, I have not tried. Art S. Kagel