esql libraries to link with
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I am tring to link compile openlink request broker (opl) to a informix db. In the scripts opl provided the compile - link line reads: cc -s -o inf71_sv inf71_sv.o -L$INFORMIX71DIR/lib/esql -L$INFORMIX71DIR/lib \\ $LIBS /usr/lib/libc.a $SYSLIBS -bloadmap:aaa || exit 1 what is the purpose of the "-L" in the line? Furthermore there are 2 lines just before this: [ -s syslibs ] && . syslibs [ -s dbpaths ] && . dbpaths what are these lines used for? there are 2 files in the dir named syslibs and dbpaths. Thanks Pete
>Subject: esql libraries to link with >From: Peter Shankey shankeyp@charlestoncounty.org >Date: 11.03.00 21:44 W. Europe Standard Time >Message-id: <38CAB045.70107805@charlestoncounty.org> > >I am tring to link compile openlink request broker (opl) to a informix >db. In the scripts opl provided the compile - link line reads: > >cc -s -o inf71_sv inf71_sv.o -L$INFORMIX71DIR/lib/esql >-L$INFORMIX71DIR/lib \\ > $LIBS /usr/lib/libc.a $SYSLIBS -bloadmap:aaa || exit 1 > >what is the purpose of the "-L" in the line? > >Furthermore there are 2 lines just before this: > > >[ -s syslibs ] && . syslibs >[ -s dbpaths ] && . dbpaths > >what are these lines used for? there are 2 files in the dir named >syslibs and dbpaths. > >Thanks >Pete Looks like an esql/c version 7.1 - you should go to Client SDK 2.40. And your .ec files really only need a rule to get compiled with the esql command. Nona
I'm sorry could you explain your answer a bit more please. thanks Pete Watawinona wrote: > >Subject: esql libraries to link with > >From: Peter Shankey shankeyp@charlestoncounty.org > >Date: 11.03.00 21:44 W. Europe Standard Time > >Message-id: <38CAB045.70107805@charlestoncounty.org> > > > >I am tring to link compile openlink request broker (opl) to a informix > >db. In the scripts opl provided the compile - link line reads: > > > >cc -s -o inf71_sv inf71_sv.o -L$INFORMIX71DIR/lib/esql > >-L$INFORMIX71DIR/lib \\ > > $LIBS /usr/lib/libc.a $SYSLIBS -bloadmap:aaa || exit 1 > > > >what is the purpose of the "-L" in the line? > > > >Furthermore there are 2 lines just before this: > > > > > >[ -s syslibs ] && . syslibs > >[ -s dbpaths ] && . dbpaths > > > >what are these lines used for? there are 2 files in the dir named > >syslibs and dbpaths. > > > >Thanks > >Pete > > Looks like an esql/c version 7.1 - you should go to Client SDK 2.40. And your > .ec files really only need a rule to get compiled with the esql command. > > Nona
Peter Shankey wrote: > I am tring to link compile openlink request broker (opl) to a informix > db. In the scripts opl provided the compile - link line reads: > > cc -s -o inf71_sv inf71_sv.o -L$INFORMIX71DIR/lib/esql > -L$INFORMIX71DIR/lib \\ > $LIBS /usr/lib/libc.a $SYSLIBS -bloadmap:aaa || exit 1 > > what is the purpose of the "-L" in the line? > > Furthermore there are 2 lines just before this: > > [ -s syslibs ] && . syslibs > [ -s dbpaths ] && . dbpaths > > what are these lines used for? there are 2 files in the dir named > syslibs and dbpaths. The cc command is creating a stripped executable inf71_sv. Since it is also linking ESQL/C code, it is being done all wrong -- you must use the esql script to do linking. Nothing else will work reliably across upgrades. Use: esql -o inf71_sv inf71_sv.o -bloadmap:aaa This should fail to link, however. You then have to look in the syslibs file and see what it is setting SYSLIBS to. You edit out the references to Informix libraries, and I'd omit libc.a since the compiler automatically links the C library (using a shared library too). The other libraries might be required -- might, because some of them will have been derived from the libraries listed by the esql script, and others will be related to the software you're installing. The -L option to the C compiler indicates where the link phase should hunt for libraries. The esql script provides these values automatically. The dbpaths script probably sets something like LD_LIBRARY_PATH... As Watawinona pointed out, you should not be using ESQL/C 7.1x (period). You should be aiming to use Client SDK 2.40 (ESQL/C 9.30) or thereabouts. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>