On Tue, 25 Jul 2000 [EMAIL PROTECTED] wrote:
> Mo DeJong wrote:
> >
> > I have tracked down one of the strange link error that I
> > am getting from libtool. It is caused by what (IMHO) seems
> > to be a bug in libtool, -l arguments are silently removed
> > from the link line is the libtool script can not locate
> > the library file. Here is an example of the problem I am
> > seeing.
> >
> > /bin/sh ../libtool --mode=link i386-mingw32msvc-gcc -DBUILD_TkGS
> > -I/home/mo/project/tk/win -I/home/mo/project/tk/xlib -DUSE_TCL_STUBS
> > -I/home/mo/project/tcl/generic -I/home/mo/project/tk/generic -I/home/
> > mo/project/tkgs/src -I/home/mo/project/tkgs/src/generic -g -O2
> > -o libtkgs.la -rpath /tmp/tkgs_Xmingw/lib -no-undefined -avoid-version
> > -L/home/mo/project/build/tcl_Xmingw -ltclstub84d
> > -L/home/mo/project/build/tk_Xmingw -ltkstub84d
> > -lgdi32 tkgs.lo tkgsColor.lo tkgsDrawable.lo tkgsFont.lo tkgsInit.lo
> > tkgsObj.lo tkgsWinInit.lo drivers/ps/libtkgs_ps.la
> > drivers/canvas/libtkgs_canvas.la drivers/win32/libtkgs_win32.la
> >
> > There is quite a lot there, but focus on the -lgdi32 argument. It
> > is passed into the libtool script, but it does not seem to
> > make it into the .dll link step:
> >
> > make
> > ...
> > *** Warning: This library needs some functionality provided by -lgdi32.
> > *** I have the capability to make that library automatically link in when
> > *** you link to this library. But I can only do this if you have a
> > *** shared version of the library, which you do not appear to have.
> > *** The inter-library dependencies that have been dropped here will be
> > *** automatically added whenever a program is linked with this library
> > *** or is declared to -dlopen it.
> > generating symbol list for `libtkgs.la'
> >
>
> Please read the thread about Linking static libaries into libtool
> (shared) ones.
> Libtool is behaving exactly in the way it is telling you it will. Static
> libraries can not portably be linked into shared ones so libtool wont do
> it. However if you use libtool to create an actual executable using your
> library libtool will automaticaly link the static library into the
> executable.
>
> Regards,
> Jan
Well, that is just it. I am never going to make an executable
out of the library. I need to produce a .dll under Windows that
can be loaded by name at runtime. It seems that this is just not
possible with libtool, which I find odd because this
is exactly the sort of thing that libtool should have
been designed to do. I know it was not developed with
stupid Windows .dll rules in mind, but it would seem
that the current version does not work unless all
my .c files are in the same directory and I compile
them all into one .dll. I had to give up on libtool
and switch to just using autoconf + automake because
of this problem.
Mo DeJong
Red Hat Inc