Re: undefined referenced to 'crypt'
Posted in 1998
On Wed, 14 Oct 1998, Ahmad Munif wrote: > i tried to compile a file, with this command : > esql -o demo demo1.ec > then appeared error message : > /root/esql/lib/esql/libixos.so undefined reference to 'crypt' > so the compilation is failed. what's going on, and how to fix it ? > thanks. > ps. i'm using esql/c for linux Of course you are, and probably RedHat 5.1 or another glibc port of Linux, as opposed to, say, Caldera 1.2. As I wrote a couple of weeks ago, you can get around this by hacking the ESQL/C script. Here's my post to c.d.i from 1st October. You can look for such answers via DejaNews, of course... Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn PS: I've done more work with it since I posted the original messages, and I still haven't found anything I could identify as a problem with RedHat. The only thing I've had problems with is getting sqlexecd to actually accept any connections -- I haven't yet suffered from any zombies because I haven't managed to connect via sqlexecd. But that's a subject for another thread. =========================================================================== Date: Thu, 1 Oct 1998 13:51:33 -0700 (PDT) From: Jonathan Leffler <jleffler@informix.com> To: Jonathan Leffler <jleffler@earthlink.net> Cc: informix-list@iiug.org Subject: Re: LINUX/SE problem, error #25591 On Wed, 30 Sep 1998, Jonathan Leffler wrote: > EsquivelR wrote: > > Where can I get SE for RH Linux? > > Well, it depends on what you want. > > I'm using RH 5.1 on a machine at home and a machine in the office, > and I'm using the SE and ESQL/C 7.24.UC5 released back in July. > > I made two sets of changes to the esql script to get it to work the > way I want it to: > * Add -lcrypt after -lm > * Add code to recognize '-c' as an option, and > * Add code to zap all the library names when -c was > used as an option because GCC complains if you say > gcc -c xyz.c -lm > > With those two (or three; it depends on how you count them) changes, > I've been running my SQLCMD program quite happily. That's a non- > trivial hunk of ESQL/C code. On my machine at home, I had enough > disk space to install Everything; on the machine in the office, I > had 1/10th the space, so I didn;t install everything. I don't think > that I'm using the libc5 compatability libraries on either machine, > but equally, I'm not running into problems. > > I've had other reports that there are problems with RH. > > The 25591 error sounds like a networking problem. Use seipcpip > connections instead unless you've got a very good reason no to do so. > > Remember: I speak for myself, not for Informix -- especially this time. And here's a patch file (unified diff) of the changes I made. As I said, this is working for me on RedHat 5.1, but YMMV. Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn --- esql.original Mon Jul 13 22:59:44 1998 +++ esql Wed Sep 30 16:46:56 1998 @@ -119,16 +119,17 @@ GLSLIB=-lixgls GLXLIB=-lixglx NETSTUB="${INFDIR}/lib/libnetstub.so " fi -SYSLIB="-lm " +SYSLIB="-lm -lcrypt" SYSNLIB="" TLILIB="" THLIB=$THREADLIB CHKAPI=${INFDIR}/lib/esql/checkapi.o LPATH=${INFDIR}/lib +DOLINK=yes nettli="TRUE" # check for the existence of libraries specified in TLILIB if test "x$TLILIB" = "x" then @@ -375,10 +376,15 @@ ;; "" ) break; ;; + -c ) + DOLINK=no + A="$A $1" + shift + ;; * ) A="$A $1" shift ;; esac @@ -436,10 +442,24 @@ # compile .C (c++) files if test "$B" then $CPP $INCLUDE -I$INFDIR/incl/esql -c $B +fi + +if test "$DOLINK" = no +then + ALIB= + CHKAPI= + COMB= + GLIB= + GLSLIB= + GLXLIB= + OLIB= + SLIB= + SYSLIB= + SYSNLIB= fi # compile .c files, link with c++ .o's in $BO if test "$STATOPT" then