Re: [ROOT] Library using class from a different library

From: Valery Fine (fine@bnl.gov)
Date: Sun Jan 28 2001 - 06:42:44 MET


> Hi Christian,
> 
>    this will work fine on all platforms I know of, except on Windows
> and AIX. On Windows and AIX a .so needs to resolve all symbols at .so
> link time and that would not be possible in this case. 

The question is whether the class method from one DLL/share library can call some
class method from another DLL/share library.
I see no problem under Windows. This is how many of the ROOT DLLs are organized.
Microsoft  linker does need (with the options used to create ROOT DLLs) all 
external references to be resolved at link time. However the symbol definitions are 
delivered from the "export" libraries rather from the DLLs and cause no conflict.
baecause creating "Export" libraires doesn't require "all symbols to be resolved".
This means there is no problem to create "export" libraries for *all* DLL's first, then build 
all DLLs each against of all "export" libraries. This way each DLL can be built and all
external symbols are to be resolved with no problem.

> A typical solution would be to call the classes in the other lib via an abstract interface, etc.

 I agree usually this makes the code cleaner.

                                             Valeri
> 
> Cheers, Fons.
> 
> 
> On Fri, Jan 26, 2001 at 07:44:34PM +0100, cstrato@EUnet.at wrote:
> > Dear Rooters
> > 
> > I would like to build two libraries. Both contain custom classes derived
> > from TObject.
> > LibA.so contains classes ClassA and ClassB
> > LibB.so contains classes Class1 and Class2.
> > 
> > What do I have to include in  LibB.so, if methods of LibB.so use ClassA
> > or ClassB from LibA.so?
> > 
> > Thank you for your help.
> > 
> > Best regards
> > C.h.r.i.s.t.i.a.n  S.t.r.a.t.o.w.a
> > Vienna, Austria
> 
> -- 
> Org:    CERN, European Laboratory for Particle Physics.
> Mail:   1211 Geneve 23, Switzerland
> E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
> WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910
> 



This archive was generated by hypermail 2b29 : Fri Jun 08 2001 - 11:50:58 MEST