Hi Kevin,
On Tue, Apr 11, 2000 at 02:43:23AM -0400, Kevin Atkinson wrote:
> On Mon, 10 Apr 2000, Ossama Othman wrote:
> > Right. I don't have access to all of the platforms supported by libtool's
> > C library support so I wasn't able to configurations for all of the
> > platforms. Any contributions would be more than welcome.
>
> What can I do. Shouldn't it work about the same when g++ is the C++
> compiler. What type of information can I send you or what can I do
> without having intimate knowledge of how libtool works.
Yes, but the way things are setup right now g++ has to be configured
for each platform. I forget why I did that. In any case, I can
probably add a default g++ configuration, such as what is done for gcc
when building C shared libraries. That should help you out.
> > I'm a bit confused here. What does compiling libtstdc++ have to do with
> > libtool? The gcc/libstdc++ distribution has its own support for compiling
> > that library as a shared one.
>
> Because libstdc++ is compiled ONLY as a static library. When I tried
> creating a C++ shared library it tried to put the static library into the
> shared library which failed miserably as the code does was not compiled
> with PIC support. At least that is what I think happened.
That sounds about right. Libtool doesn't try to do too much magic,
nor should it, IMO. If the g++ installation doesn't support C++ shared
libraries then neither will libtool.
> > Try using g++'s -nostdlib flag, or one of the other related ones when
> > configuring your library. If I set things up properly, libtool should
> > use that flag when configuring the C++ support, and avoid linking in
> > libstdc++. Note that -nostdlib will also prevent the start files from
> > being linked in.
>
> I will try that. How about a more generic solution.
Do you mean that you would like libtool to have the ability to not
link in certain libraries? I suppose we could add an option to do
that but I don't think that is very portable since I'm not sure if all
C++ compilers provide a flag that prevents linking in certain system
libraries, which the "generic" solution would need.
>From what I recall, libtool currently doesn't support such a feature.
Does anyone have any thoughts on such a feature?
> > > 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.
> >
> > You're linking C++ libraries to a C program? That seems a bit odd. Did I
> > misunderstand you?
>
> Why? I have a library that is written in C++ but I would like C programs
> to be able to use my library via extern "C" functions. What is so strange
> about that?
Not much I guess. I'm just used to going in the other direction,
i.e. writing C++ programs that link in C libraries. Linking C++
libraries into a C program puts a real limit on what you can do in
terms of object oriented design, which I need. However, you are
entirely correct that extern "C" functions will certainly work with C
programs. I just happen not to write C programs. :-)
-Ossama
--
Ossama Othman <[EMAIL PROTECTED]>
Distributed Object Computing Laboratory, Univ. of California at Irvine
1024D/F7A394A8 - 84ED AA0B 1203 99E4 1068 70E6 5EB7 5E71 F7A3 94A8