libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with C API in C++ static library


From: Bob Friesenhahn
Subject: Re: help with C API in C++ static library
Date: Fri, 15 Jan 2010 16:55:36 -0600 (CST)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Fri, 15 Jan 2010, Jason Kraftcheck wrote:

Linking with the C++ compiler would address my immediate problem of linking
my test code, by still produces a library intended to be linked with C code
that requires using the c++ compiler to link.  I had hoped that libtool's
.la files would provide the same feature for static libraries as the shared
library dependency list.

What you are trying/wanting to do is just not portable. Sometimes it won't work at all. Sometimes it will appear to work most of the time. Sometimes it will always work.

Why doesn't libtool include necessary runtime libraries in the
dependency_libs field of .la files?  I understand that historically there
were other issues like initialization of static/global data in C++ code.  Is
that still an issue on some platforms?  The GNU compiler seems to handle
this correctly for a simple test case.

Libtool does not encourage behavior which is not portable or is unreliable. Libtool is not capable of changing history. Older systems continue to be in active use.

It is true that C++ does require more/different initialization than C code does. The C compiler is not assured to supply the necessary initialization required by C++ code.

Bob
--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]