On 26 Jul 2000, Alexandre Oliva wrote:
> On Jul 26, 2000, Mo DeJong <[EMAIL PROTECTED]> wrote:
>
> > If the error said "libtool can not link a static library into
> > the shared library you are trying to create" then I would
> > agree with you. The existing warning does not tell me that.
>
> Please suggest a better wording.
I guess this will need some sort of platform switch.
if (UNIX)
sane warning
else if (WIN)
error out because .dlls are stupid
> > Why is it a warning? This should be an error. If I tell it
> > "use -lgdi32" it should use it or error out.
>
> Nope. -lgdi32 is being recorded as a required dependency, and it will
> be linked in when any executables or other libraries are linked with
> the library you're creating. From the abstract point of view of
> libtool archives, whether you get a dynamic library or an ordinary
> archive is irrelevant. If you play by the rules, it shouldn't make
> any difference.
>
> But I understand this all breaks down on MS-Windows, in which object
> files created for dynamic libraries are completely different from
> those created for static libraries. I don't know how to solve this
> problem. We need some way for the build process to figure out in
> advance whether it'll be able to generate the shared library with a
> given set of dependency libraries, so that it can pass the appropriate
> flags to the compiler. Gee, DLLs suck :-(
Welcome to my world. I have been fighting this DLL junk for
more than a week.
> > I gave up on libtool and just switched to autoconf + automake
> > with the ld -shared option and it is working just fine
> > (the linking of a static lib into a .dll that is).
>
> If you care about keeping using libtool, maybe -Wl,-lthestaticlib will
> work for now. Libtool won't realize it's a dependency, but it may
> work.
>
> I wonder whether the symbols imported from a static library into a DLL
> are re-exported, and how data symbols work in this case.
Nope, if you make a static lib it simply can not have exported
stuff in it. It has too be all static. You can link that
into a .dll but the dll can not "re-export" symbols. At least,
I think that is how it works. I am no .dll expert (and I don't
want to be one, .dlls just suck). I am also not sure if you
want to carry the static .a dep along with libtool.
Mo DeJong
Red Hat Inc