On Mon, 10 Apr 2000, Kevin Atkinson wrote:
> About a week ago I posted this massage to the libtool mailing but I have
> yet to receive any replies.
Don't feel too bad. I have posted questions to the libtool list quite
a number of times, but rarely receive any response (most responses
from Ossama). I think that answers (which include a patch) are more
highly regarded than questions.
Regarding your Problem 2, the way the library I maintain (ImageMagick,
http://www.imagemagick.org) does it, each module exposes unique
symbols using a pre-defined naming scheme so that the module loader
computes the correct name for symbol in the module. Only one symbol
needs to be loaded. The rest of the symbols are registered via
call-back from the module itself. This eliminates any need for the
pre-loading complexity. The library has 72 modules. I doubt that the
command line can reliably pass enough parameters to handle libtool's
preload requirement for 72 modules.
With the above scheme (using call-backs to the library), there may
still be a requirement for special linkage for programs. The libtool
docs specify that if libtool is used to link the program,
-export-dynamic must be specified.
Bob
>
> I could REALLY use some help here. I understand I am using a
> developmental version and will be willing to work with you to help improve
> libtools.
>
> Maybe I should just not use the CXX language features and just some how
> make sure all the right libraries get linked in and just avoid using
> global variables which require initilization...
>
> Please give me some guidance here.
>
> ---------- Forwarded message ----------
> Date: Tue, 4 Apr 2000 17:40:01 -0400 (EDT)
> From: Kevin Atkinson <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Shared libraries w/ C++ and libltdl.
> Resent-Date: Tue, 4 Apr 2000 17:39:36 -0400
> Resent-From: [EMAIL PROTECTED]
>
> I am having all sorts of problems with shared libraries and C++ with the
> multi-lang. branch.
>
> PROBLEM 1
>
> 1) On many platforms libtool can create shared libraries for C but not for
> C++
>
> 2) On many of the platforms which libtool does know how to create C++
> shared libraries libstdc++ is not compiled as a shared library, nor is it
> compiled with PIC support. This means that linking the shared library
> fails miserably because it will try to link the non PIC code into the
> shared library.
>
> So my question is
>
> 1) Is there a way to force libtool NOT to link it as a C++ library if it
> can't do it as a shared library. IE don't fall back to only making a
> static library.
>
> 2) Is there a way to force libtool NOT to link in libstdc++ but STILL link
> it using c++?
>
> In either case I would like the C++ libraries to be specified in the .la
> files so that they will get statically linked in by libtool when a C program
> uses my libraries.
>
> PROBLEM 2
>
> Is they a way to do the ldpreloding stuff that is 100% transparent to
> programs linking with my libraries using libtool? I want the end user to
> have to doing noting but "libtool --mode=link ... -l<My library>" and have
> libtool automatically preload the necessary modules and set up the data
> structure automatically so that the end user does NOT have to call
> LTDL_SET_PRELOADED_SYMBOLS().
>
>
> Thanks in advance. Any advice you can give me would really help me out
> with my Pspell (http://pspell.sourceforge.net) project.
>
> ---
> Kevin Atkinson
> [EMAIL PROTECTED]
> http://metalab.unc.edu/kevina/
>
>
======================================
Bob Friesenhahn
[EMAIL PROTECTED]
http://www.simplesystems.org/users/bfriesen