Custom 4GL runner
Posted in 2003
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues, Versions, Editions & End-of-Life
Guys- I am trying to create a custom runner, so I can give our QA's a random sample of lots to test. I downloaded a c function (from IIUG) to generate a random number, but when I try to link it, ld errs out. Like this: cfglgo random.c -o myfglgo ld: Unsatisfied symbol "usrcfuncs" in file /usr/informix/lib/tools/libfglgo.a[fgitable.o] ld: Unsatisfied symbol "pushint" in file random.o ld: Unsatisfied symbol "popint" in file random.o 3 errors. If I read the manual correctly, it needs to include a library called fglrt.h. I tried adding it to the C code, but it errs out with this message: cpp: "random.c", line 7: error 4036: Can't open include file 'fglrt.h'. Where does it live? I went to $INFORMIXDIR (/usr/Informix) and ran find . -name fglrt.h, but it came up empty. I don't know if it will help, but my LD_LIBRARY_PATH is this: /usr/informix/lib:/usr/informix/lib/esql: The platform is HP-UX 11.0 (64 bit), IDS 7.31.FD4, 4GL-RDS 7.31.FC1, esql 9.51.FC3 and the c compiler is gcc. Everett E. Mills Systems Administrator/Programmer National Beef Packing Co., LLC. P. O. Box 539 Dodge City, KS 67801-0539 Voice: (620)338-4288 Fax: (620)338-4335 E-Mail: eemills@nationalbeef.com sending to informix-list
Everett Mills wrote: > Guys- > I am trying to create a custom runner, so I can give our QA's a > random sample of lots to test. I downloaded a c function (from IIUG) to > generate a random number, but when I try to link it, ld errs out. Like > this: > > cfglgo random.c -o myfglgo > ld: Unsatisfied symbol "usrcfuncs" in file > /usr/informix/lib/tools/libfglgo.a[fgitable.o] > ld: Unsatisfied symbol "pushint" in file random.o > ld: Unsatisfied symbol "popint" in file random.o > 3 errors. For usrcfuncs, you need to look at the code in $INFORMIXDIR/etc/fgiusr.c and either include it in random.c (if you are only ever going to need the one additional function - or a pair of them; one to set the seed and one to generate numbers), or copy the file locally and compile it as a separate object and include it in the link line. Either way, you need to extend it with the functions you add to the runner. For pushint and popint, you should include "fglsys.h" in the C code. Also, I would expect you to be using retint rather than pushint. You use pushint when you are putting values on the I4GL stack to be used by the next called I4GL function; you use retint when you are trying to return values to the calling function. > If I read the manual correctly, it needs to include a library called > fglrt.h. I tried adding it to the C code, but it errs out with this > message: No - fglrt.h is unlikely to the answer. It has a purpose, but not this one. > cpp: "random.c", line 7: error 4036: Can't open include file 'fglrt.h'. > > Where does it live? I went to $INFORMIXDIR (/usr/Informix) and ran find > . -name fglrt.h, but it came up empty. Not sure. Check in the files list ($INFORMIXDIR/etc/fgpfiles, I think) and see whether it is listed in there. If not, then presumably it comes with the c-code compiler and not the p-code compiler - a little odd. > I don't know if it will help, but my LD_LIBRARY_PATH is this: > /usr/informix/lib:/usr/informix/lib/esql: You might need to think about adding /usr/informix/lib/tools, and on HP-UX, you need to use LIBPATH rather than LD_LIBRARY_PATH, don't you? > The platform is HP-UX 11.0 (64 bit), IDS 7.31.FD4, 4GL-RDS 7.31.FC1, > esql 9.51.FC3 and the c compiler is gcc. Using gcc can be fun, too. You may need to do some cleanup work in your copy of cfglgo -- you did make a backup first, didn't you (and you've got the original media somewhere safe, too, haven't you?) -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/