New Informix install - can't compile
Posted in 2000
On a new SCO 5.0.5 development box, linking I4GL 7.2x programs with c4gl failed with an undefined symbol 'getspnam' referenced from lib4gsh720.so, although the same code built fine on the production SCO server. Advice was that the shared library references getspnam (a shadow-password function) but no system library supplying it was being linked, and to use nm to find which /lib or /usr/lib library defines it and add it to the link line. The poster fixed it by adding -L /usr/lib to CFLAGS, with a suggestion to put that into the c4gl script.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Installation, Setup & Upgrades, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
We are new to informix and setup a development server (SCO 5.0.5). The code compiles fine on the production server (Also SCO). We are running Online 7.3. It keeps complaining about a file lib4gsh720.so. The file exists in the informix dir and in the Unix dir /usr/lib. ls -l on the file: -rwxr-xr-x 1 informix informix 1195300 Feb 29 14:09 /u/ifmx/lib/tools/lib4gsh720.so c4gl -shared arcustq1.o com_qref.o com_rtn2.o com_rtns.o emcustm1.o emd gcdq1.o emsclhq1.o emtermq1.o fmsjrnl1.o get_menu.o utmanyq1.o utmenmq1.o utopt jq1.o -o emcustm1.4ge Undefined first referenced symbol in file getspnam /u/ifmx/lib/tools/lib4gsh720.so emcustm1.4ge: fatal error: Symbol referencing errors. No output written to emcus tm1.4ge *** Error code 1 (bu21) Any ideas? Thanks Gary Quiring
The system where I4GL 7.2x was produced had getspnam in a library; your system doesn't. See if you can find a function getspnam in any of the libraries in /lib or /usr/lib. If so, add that library to the end of the link line. If not, try to find out which vesion of which library does have it. The function is to get an entry from the shadow password file by user name. I've seen this problem reported before; I don't recall hearing a definitive solution. Gary Quiring wrote: > We are new to informix and setup a development server (SCO 5.0.5). > The code compiles fine on the production server (Also SCO). We are > running Online 7.3. It keeps complaining about a file lib4gsh720.so. > The file exists in the informix dir and in the Unix dir /usr/lib. > > ls -l on the file: > -rwxr-xr-x 1 informix informix 1195300 Feb 29 14:09 > /u/ifmx/lib/tools/lib4gsh720.so > > c4gl -shared arcustq1.o com_qref.o com_rtn2.o com_rtns.o emcustm1.o > emd > gcdq1.o emsclhq1.o emtermq1.o fmsjrnl1.o get_menu.o utmanyq1.o > utmenmq1.o utopt > jq1.o -o emcustm1.4ge > Undefined first referenced > symbol in file > getspnam /u/ifmx/lib/tools/lib4gsh720.so > emcustm1.4ge: fatal error: Symbol referencing errors. No output > written to emcus > tm1.4ge > *** Error code 1 (bu21) > > Any ideas? > > Thanks > Gary Quiring -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>
On Tue, 29 Feb 2000 14:51:29 -0500 Gary Quiring wrote: > We are new to informix and setup a development server (SCO 5.0.5). > The code compiles fine on the production server (Also SCO). We are > running Online 7.3. It keeps complaining about a file lib4gsh720.so. > The file exists in the informix dir and in the Unix dir /usr/lib. > > ls -l on the file: > -rwxr-xr-x 1 informix informix 1195300 Feb 29 14:09 > /u/ifmx/lib/tools/lib4gsh720.so > > > c4gl -shared arcustq1.o com_qref.o com_rtn2.o com_rtns.o emcustm1.o > emd > gcdq1.o emsclhq1.o emtermq1.o fmsjrnl1.o get_menu.o utmanyq1.o > utmenmq1.o utopt > jq1.o -o emcustm1.4ge > Undefined first referenced > symbol in file > getspnam /u/ifmx/lib/tools/lib4gsh720.so > emcustm1.4ge: fatal error: Symbol referencing errors. No output > written to emcus > tm1.4ge > *** Error code 1 (bu21) > Do you have LD_LIBRARY_PATH set ? Will it compile succesfully with static linkage. /J\\ -- Jonathan Stowe http://www.gellyfish.com http://www.tackleway.co.uk
On Wed, 01 Mar 2000 05:22:38 GMT, Jonathan Leffler <jleffler@earthlink.net> wrote: >The system where I4GL 7.2x was produced had getspnam in a library; >your system doesn't. See if you can find a function getspnam in any of >the >libraries in /lib or /usr/lib. If so, add that library to the end of the >link line. >If not, try to find out which vesion of which library does have it. The >function >is to get an entry from the shadow password file by user name. > I did a strings and the lib seems to exist: emco1:/u/ifmx/lib/tools # strings lib4gsh720.so|grep getspnam ifx_getspnam __osgetspnam getspnam _osgetspnam Gary Quiring
Gary Quiring wrote: > Jonathan Leffler <jleffler@earthlink.net> wrote: > >The system where I4GL 7.2x was produced had getspnam in a library; > >your system doesn't. See if you can find a function getspnam in any of the > > >libraries in /lib or /usr/lib. If so, add that library to the end of the > link line. > >If not, try to find out which vesion of which library does have it. The > function > >is to get an entry from the shadow password file by user name. > > I did a strings and the lib seems to exist: > > emco1:/u/ifmx/lib/tools # strings lib4gsh720.so|grep getspnam > ifx_getspnam > __osgetspnam > getspnam > _osgetspnam What you've done, unfortunately, is demonstrate what the linker already told us, namely that there are references to getspnam in the I4GL shared library. You need to find a system library (in /lib or /usr/lib or /usr/ccs/lib or any other non-Informix location you care to look in) and see whether you can find a definition of getspnam in that library. The better tool to use is 'nm(1)' which tells you whether a symbol is defined or not. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>
On Thu, 02 Mar 2000 05:37:09 GMT, Jonathan Leffler <jleffler@earthlink.net> wrote: > > >Gary Quiring wrote: > >> Jonathan Leffler <jleffler@earthlink.net> wrote: >> >The system where I4GL 7.2x was produced had getspnam in a library; >> >your system doesn't. See if you can find a function getspnam in any of the >> >> >libraries in /lib or /usr/lib. If so, add that library to the end of the >> link line. >> >If not, try to find out which vesion of which library does have it. The >> function >> >is to get an entry from the shadow password file by user name. >> >> I did a strings and the lib seems to exist: >> >> emco1:/u/ifmx/lib/tools # strings lib4gsh720.so|grep getspnam >> ifx_getspnam >> __osgetspnam >> getspnam >> _osgetspnam > Thanks for all the help, I finally got it. I added an option to the CFLAGS -L /usr/lib. That works. I don't understand how the production server is compiling it without this, but it's working. Thanks Gary Quiring
It is a most unusual C compiler that, on Unix, has to be told to look in /usr/lib for libraries. Still, I'm glad it is now resolved -- and as easily. I think I'd edit this into the c4gl script if I were you. Gary Quiring wrote: > On Thu, 02 Mar 2000 05:37:09 GMT, Jonathan Leffler > <jleffler@earthlink.net> wrote: > > > > > > >Gary Quiring wrote: > > > >> Jonathan Leffler <jleffler@earthlink.net> wrote: > >> >The system where I4GL 7.2x was produced had getspnam in a library; > >> >your system doesn't. See if you can find a function getspnam in any of the > >> >libraries in /lib or /usr/lib. If so, add that library to the end of the > link line. > >> >If not, try to find out which vesion of which library does have it. The > function > >> >is to get an entry from the shadow password file by user name. > >> > >> I did a strings and the lib seems to exist: > >> > >> emco1:/u/ifmx/lib/tools # strings lib4gsh720.so|grep getspnam > >> ifx_getspnam > >> __osgetspnam > >> getspnam > >> _osgetspnam > > > Thanks for all the help, I finally got it. I added an option to the > CFLAGS -L /usr/lib. That works. I don't understand how the > production server is compiling it without this, but it's working. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>