[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: linking dll against static libs
From: |
joerg . faschingbauer |
Subject: |
Re: linking dll against static libs |
Date: |
Sun, 09 Oct 2005 21:07:52 +0200 (CEST) |
>>>>> "Elmar" == Elmar Rudigier <address@hidden> writes:
Elmar> Hi!
Elmar> I'm building a dll for jni, which has dependencies to some, with libtool
static
Elmar> builded, libs. I'm using cccl as compiler.
Elmar> For win32 libtool prohibits linking shared libs against static libs and
i get
Elmar> following messages
Elmar> ...
Elmar> *** Warning: This system can not link to static lib archive
Elmar> /wamas/test/jni/WX/cccl/lib/libwx-entitycontainer_filter.la.
Elmar> *** I have the capability to make that library automatically link in when
Elmar> *** you link to this library. But I can only do this if you have a
Elmar> *** shared version of the library, which you do not appear to have.
Elmar> ...
Elmar> But if i exclude the test from libtool, that libtool isn't comlpaining
about,
Elmar> cl.exe can link the dll against the static libs and this dll can be
loaded
Elmar> without problems from java.
Elmar> So, why libtool prohibits this linking.
When you inadvertently build two DLLs that each contain a copy of the
same static library, then you are begging for trouble. Before gcc 3,
for example, this was the case for shared C++ libraries which each
brought its own copy of libgcc.a into the executable.
I believe this common user error (and the entailed support requests)
lead the libtool developers to introducing the check you are talking
about. If I'm right, then how about a flag, say,
-i-know-what-im-doing?
Btw, what is the story behind -no-undefined?
Joerg