fam
[Top] [All Lists]

Re: [fam] Class names

To: rusty@xxxxxxx
Subject: Re: [fam] Class names
From: Waldo Bastian <bastian@xxxxxxx>
Date: Fri, 12 May 2000 17:08:02 -0700
Cc: fam@xxxxxxxxxxx
In-reply-to: <10005111728.ZM35420@xxxxxxxxxxxxxxxxxx>
References: <00051111202002.21991@wantelbos> <10005111728.ZM35420@xxxxxxxxxxxxxxxxxx>
Sender: owner-fam@xxxxxxxxxxx
On Thu, 11 May 2000, you wrote:
> > I encountered some problems when linking KDE programs with FAM. The
> > problem is caused by libfam containing "Client" as class. This collides
> > with programs which define such a class as well.
>
> I just tried a little test program containing its own Client class
> (including some of the same methods as the Client class in libfam), and
> was able to link it with libfam; then I tried moving the client class into
> a separate shared library and linking with that, so the program was linking
> with two different libraries containing classes called Client, and it all
> linked & ran OK on both Linux & IRIX.  (On IRIX I got warnings about the
> multiple definitions, though.) 

I encountered problems in a KDE application which dlopened a library which 
used Client as well. The problem was that the wrong destructor got called. A 
very nasty error since it took me some time to realize what was going on.

It was remarkable that if I didn't dlopen the library but linked it directly 
into the application, the problem didn't occur.

> I can send you the little test if you want
> to see whether it works on your machine, but you're right that it should be
> fixed.
>
> libfam should export only the symbols listed in fam.h.  I know how to do
> this with SGI compilers; does anyone know how to do it with g++/GNU ld?

I suggest you use libtool's -export-symbols option. It should take care of 
any platform-dependencies.

Cheers,
Waldo

--
Source code, list archive, and docs: http://oss.sgi.com/projects/fam/
To unsubscribe: echo unsubscribe fam | mail majordomo@xxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>