libtool
[Top][All Lists]
Advanced

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

C++ convenience libraries


From: kmescher
Subject: C++ convenience libraries
Date: Tue, 19 Aug 2003 10:36:20 -0400

I'm trying to build a shared C++ library, and I'm running into a problem with 
the convenience libraries.  I'll describe the structure:


libshared.la needs foo/libfoo.la and bar/libbar.la

All the libraries have C++ code, being compiled with g++ V3.3


In the foo/Makefile.am and bar/Makefile.am, I have these lines:
(where xxx is the name of the library)

noinst_LTLIBRARIES = libxxx.la



When libtool builds these convenience libraries, it adds the static libstdc++ 
library (by extracting the contents of libstdc++, then adding it to the 
convenience library)

When libtool builds the shared library, it now has two copies of libstdc++ 
code from the convenience library, and adds one copy for itself.

libtool also extracts the contents of each convenience library, and links the 
whole mess together, instead of just adding each convenience library via a 
'-l' flag.  That alone seems a little odd. (Why does it do that?)

This causes the linker to complain with a ton of multiply defined symbols 
(rightly so, since there are at least three copies of them in each library).

What is going on?  I thought that libtool would be a little smarter.


I'm using libtool 1.5, automake 1.7, and g++ 3.3






reply via email to

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