SUMMARY: Way to include 4GL routines in custom runner?
Posted in 1994
Original post... In article <2rr425$haq@ncar.ucar.edu>, miker@ncar.ucar.edu (Mike Reetz) writes: |> Is there a way to include 4GL routines in a custom runner? |> |> I know, I know. Why is he doing this! Silly reasons really, curiosity |> mostly. The dev staff here doesn't want to have to remember to "link" |> these routines into their .4gi files. |> |> Any help? |> Thanks to Paul Pryor (ptp@fallschurch-acirs2.army.mil) for a solution: > > > > > > Hmm, I just compiled one of the 4gl module to .ec, and peeked at the > > > .ec file. It appears to be using exactly same calling convention > > > which is documented in the 4GL manual for C functions. So I would > > > just put the function names in fgiusr.c, and link a new runner. > > > > Tried this and got some unresolved/undefined symbols (as per the linker): > > > > miker-> cfglgo fgiusr.c file_io.c util_box.c -o testfglgo > > fgiusr.c: > > file_io.c: > > util_box.c: > > 0706-317 ERROR: Unresolved or undefined symbols detected: > > Symbols in error (followed by references) are > > dumped to the load map. > > The -bloadmap:<filename> option will create a load map. > > ._efprmpt > > ._efemsg > > ._efadsply > > Shoot me !!! I forgot about the support functions. I checked our > systems' Informix libraries and I found all three unresolved functions > in $INFORMIX/lib/libforms.a > > Try the following: > cfglgo fgiusr.c file_io.c util_box.c -o testfglgo -l $INFORMIX/lib/libforms.a > > If it chokes, then you probably will have to modify (better yet, copy > and then modify your copy) cfglgo script, and add libforms.a to the > list of libraries. > This was the solution. I had to add $INFORMIXDIR/lib/libnforms.a (don't know why Paul has libforms and I only have libnforms???) to the cfglgo script (tried many combinations of -l libname, even tried -L libpath but none worked) and the custom runner works. Here is a snippet of the top portion of cfglgo: INFDIR=${INFORMIXDIR=/usr/informix} ESQLC=$INFDIR/lib/esqlc FGIUSR=$INFDIR/etc/fgiusr.c LIBFMAIN=$INFDIR/lib/libfmain.a LIBFGLGO=$INFDIR/lib/libfglgo.a LIB4GL=$INFDIR/lib/lib4gl.a LIB4IO=$INFDIR/lib/lib4io.a LIBCOLOR=$INFDIR/lib/libncolor.a LIBFE=$INFDIR/lib/libfe.a LIBSQL=$INFDIR/lib/libfesql.a : added by miker LIBFORMS=$INFDIR/lib/libnforms.a : commented line was from orig cfglgo :LIBES="$LIBFGLGO $LIB4GL $LIB4IO $LIBCOLOR $LIBFE $LIBSQL" LIBES="$LIBFGLGO $LIB4GL $LIB4IO $LIBCOLOR $LIBFE $LIBSQL $LIBFORMS" Thanks also to David I. Berg (dberg@informix.com) for his help. -- ------------------------------------------------------------------------------- Mike Reetz reetz@ncar.ucar.edu 3450 Mitchell Lane UNIX(tm) Operations Manager (303)497-8881(V) 497-8501(Fax) Building 1 UCAR - University Corporation For Atmospheric Research Boulder, CO 80301