Tcl related questions
- UNDEFINED REFERENCES IN NET.O (Sun OS)
- COMPILE STOPS AT THE LAST MINUTE WITH "LD FATAL SIGNAL 11"! (Linux)
- LD: -ltcl7.4: EXPECTED LIBX.SO(.MAJOR.MINOR.XXX) (various)
- STRIP TERMINATED WITH SIGNAL 6 (various)
- 'DIR' UNDECLARED (AND A WHOLE BUNCH OF OTHERS) (AIX 4)
- 'FD_SET' UNDECLARED (AND A WHOLE BUNCH OF OTHERS) (AIX 4)
- UNRESOLVED OR UNDEFINED SYMBOLS: ldclose, ldopen, ldnshread (AIX 3)
- UNSATISFIED SYMBOLS 'shl_findsym' and 'shl_load' (HP-UX 9)
Undefined symbol | first referenced in file |
socket | net.o |
gethostbyname | net.o |
accept | net.o |
bind | net.o |
setsockopt | net.o |
gethostbyaddr | net.o |
getsockname | net.o |
gethostname | net.o |
listen | net.o |
connect | net.o |
This seems to be caused
by a few libraries not being detected by the
auto-configure program,
it is relatively easy to fix. Edit your Makefile,
note that yours may be
slightly different than this one when it comes to
the tcl library, but here
is the way it probably is:
GMAKE = ${MAKE} 'CC=gcc'
'AWK=awk' 'OBJS=${OBJS}' 'TCLLIBFN=tcl.a'\
'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS= -L/usr/local/lib -ltcl -lm'\
'TCLLIB=${TCLLIB}' 'RANLIB=:' 'STRIP='
And here is what you need to change:
GMAKE = ${MAKE} 'CC=gcc'
'AWK=awk' 'OBJS=${OBJS}' 'TCLLIBFN=tcl.a'\
'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS=-lsocket -ldl -lnsl -L/usr/local/lib
-ltcl -lm'\
'TCLLIB=${TCLLIB}' 'RANLIB=:' 'STRIP='
You are adding in three
libraries to be linked in, socket, dl, and nsl. This
will resolve the net.o
errors.
cd
mkdir lib
mkdir include
find . -name libtcl*
The output from the find command should give you the location of the library, take the output of that and do the next command with the output of find replacing $$find$$:
mv $$find$$ lib/libtcl.a
Now we continue with another find to help us locate tcl.h:
find . -name tcl.h
The output from the find command should give you the location of the header file, take the output of that and do the next command with the output of find replacing $$find$$:
mv $$find$$ include
Hopefully you know what shell you are using and can pick out which commands to use, if the first two setenv commands give command not found then use the next two, if not then don't use the next two. First set are for csh/tcsh users, following set is for bash/ksh users.
csh/tcsh:
setenv TCLLIB '$HOME/lib'
setenv TCLINC '$HOME/include'
bash/ksh:
export TCLLIB='$HOME/lib'
export TCLINC='$HOME/include'
And then finally run configure again for eggdrop and then make, and hopefully it will work.
On some Unix boxes this seems to be caused by the linker, it is expecting a specific filename format and when it doesn't live up to it's expectations it usually barfs. I always see this caused by when the library for Tcl is called libtcl7.4.a or libtcl7.5.a, rename it to simply libtcl.a if you installed Tcl yourself, if you didn't and your using the Tcl that the system installed then do this:
View your Makefile, look for the line (should be close to the top) that says
XREQ = /usr/local/lib/libtcl7.4.a
And remember that FULL pathname. Go to your home directory, and do the following:
mkdir lib
cd lib
ln -s $$xreq$$ libtcl.a
Replace $$xreq$$ with the full pathname from the XREQ line from the Makefile.
And finally the next thing you want to do depending on what shell your using is: (try the first one, if it gives bad command then use the second)
csh/tcsh:
setenv TCLLIB '$HOME/lib'
bash/ksh:
export TCLLIB='$HOME/lib'
Did I say finally? Heh, finally run configure and then make again.
I don't really know what
the hell is causing this, but I find that if you
don't strip the binary
you cut out the problem (obviously), edit your
Makefile and change this
line from:
GMAKE = ${MAKE} 'CC=gcc'
'AWK=awk' 'OBJS=${OBJS}' 'TCLLIBFN=tcl.a'\
'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS= -L/usr/local/lib -ltcl -lm' \
'TCLLIB=${TCLLIB}' 'RANLIB=ranlib' 'STRIP=-s'
To this line below:
(your lines may differ, but what you are doing is
changing 'STRIP=-s' to
'STRIP=')
GMAKE = ${MAKE} 'CC=gcc'
'AWK=awk' 'OBJS=${OBJS}' 'TCLLIBFN=tcl.a'\
'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS= -L/usr/local/lib -ltcl -lm' \
'TCLLIB=${TCLLIB}' 'RANLIB=ranlib' 'STRIP='
This seems like one of the components of configure was broken, because what apparently happened was it didn't detect that this particular system had dirent.h and sys/dir.h, solution was to add -DHAVE_DIRENT_H -DHAVE_SYS_DIR_H to the Makefile's CFLGS line...
CFLGS = -DHAVE_DIRENT_H -DHAVE_SYS_DIR_H
Again, this seems that one
of configure's components (sed, awk, or something along those lines) was
broken, and it failed to detect that this system needed sys/select.h, solution
was to add -DHAVE_SYS_SELECT_H to the Makefile's CFLGS
line...
CFLGS = -DHAVE_DIRENT_H -DHAVE_SYS_DIR_H -DHAVE_SYS_SELECT_H
(I suppose they thought a minor error would deter anyone from continuing onward, but I am not just anyone, I am a blockhead... <grin>)
Apparently what is happening is a library called ld is required, and either configure doesn't know it is needed or it simple can't find it, or maybe this is a unique case, solution was to have ld linked in with the final binary.
Edit your Makefile and find the line that looks something like this:
GMAKE = ${MAKE} 'CC=cc'
'AWK=awk' 'OBJS=${OBJS}' 'TCLLIBFN=tcl7.5.a'\
'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS= -L/home2/f/foster/lib -ltcl7.5
-lm'\
'TCLLIB=${TCLLIB}' 'RANLIB=ranlib' 'STRIP=-s'
And add in -lld into the XLIBS assignment, like this...
GMAKE = ${MAKE} 'CC=cc'
'AWK=awk' 'OBJS=${OBJS}' 'TCLLIBFN=tcl7.5.a'\
'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS=-lld -L/home2/f/foster/lib -ltcl7.5
-lm'\
'TCLLIB=${TCLLIB}' 'RANLIB=ranlib' 'STRIP=-s'
I forwarded this one to
Robey and he said that Tcl 7.5 the dl library, and that
apparently configure couldn't
detect that this was required in this case. So
try this fix, and if it
works, great, if not then use Tcl 7.4, I hear this
works. :)
GMAKE = ${MAKE} 'CC=gcc'
'AWK=awk' 'OBJS=${OBJS}' 'TCLLIBFN=tcl7.5.a'\
'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS= -L/usr/local/lib -ltcl7.5 -lm'\
'TCLLIB=${TCLLIB}' 'RANLIB=:' 'STRIP='
And here is what you need to change:
GMAKE = ${MAKE} 'CC=gcc'
'AWK=awk' 'OBJS=${OBJS}' 'TCLLIBFN=tcl7.5.a'\
'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS=-ldl -L/usr/local/lib -ltcl7.5
-lm'\
'TCLLIB=${TCLLIB}' 'RANLIB=:' 'STRIP='
Basically what you are doing
is adding in -ldl to the XLIBS declaration,
essentially at link time
you are tell it to also link in the dl library which
apparently resolves this
problem.
1. REDECLARATION IN COMPAT/UNISTD.H (Tcl 7.4/AIX 4)
Seems that configure had a brain fart... Would you believe this was the same system as in A.6 and A.7, heh, it was. Apparently it thought this system didn't have unistd.h, and was using it's compatible header, solution was to edit Makefile and change this line:
AC_FLAGS = -DHAVE_________=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -Dvfork=fork
to the following:
AC_FLAGS = -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -Dvfork=fork
Configure apparently couldn't figure this one out, probably because the system it was configured on sucks badly. Change the following line in Makefile:
COMPAT_OBJS = getcwd.o opendir.o strstr.o strtol.o tmpnam.o waitpid.o strstr.o strtoul.o strtod.o strncasecmp.o
To the following
COMPAT_OBJS = getcwd.o opendir.o strstr.o strtol.o tmpnam.o strstr.o strtoul.o strtod.o strncasecmp.o
We are deleting the waitpid.o object file. The problem was that configure didn't detect that waitpid() wasn't necessary, so it caused a compatible waitpid() function to be compiled.
Configure couldn't find or detect that nsl and socket libraries were required, so we have to force it to use them. The solution is to edit Makefile and change the following line:
LIBS = -ldl
To the following:
LIBS = -ldl -lnsl -lsocket
Configure apparently couldn't figure this one out, probably because the system it was configured on sucks badly. Change the following line in Makefile:
COMPAT_OBJS = getcwd.o opendir.o strstr.o strtol.o tmpnam.o strstr.o strtoul.o strtod.o strncasecmp.o
To the following
COMPAT_OBJS = opendir.o strstr.o strtol.o tmpnam.o strstr.o strtoul.o strtod.o strncasecmp.o
We are deleting the getcwd.o object file. The problem was that configure didn't detect that getcwd() wasn't necessary, so it caused a compatible getcwd() function to be compiled.
export
TCLLIB=/path/to/tcl/lib
export
TCLINC=/path/to/tcl/include
Please note that on some unix machines export doesn't work and you have to use 'setenv' instead or to pass configure the full qualified path to tcl:
./configure --with-tcllib=/path/to/libtclx.x.so --with-tclinc=/path/to/tcl.h