Re: [ROOT] 2 dictionnaries ?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Sep 23 2002 - 09:05:35 MEST


Hi Colin,

Please indicate which version of Root and the platform?

see below

On Sun, 22 Sep
2002, Colin Bernet wrote:

> 
> Hi rooters ! 
> 
> Loading 2 shared libraries, each containing a dictionnary, or a single
> shared library containing 2 dictionnaries seems to be impossible. In the
> first case, symbols from the secodn library are not recognized by root,
> while in the second case, the created objects get stuck at one point for
> unknown reasons. 
> 
> What I want to do is : 
> 1 - Fill trees (split 99) using classes located in lib1.so
> 2 - Use MakeClass on one of these trees, modify the code so it compiles,
> and create a shared library lib2.so out of that. 
> 

This should work. Why do you have to modify the code to get it compiled?
please try version 3.03/09 in case you use older versions.

> The only way to work that out was to create a library demo.so using
> TFile::MakeProject.
> in ROOT, I can then do 
> .L demo.so 
> .L lib2.so
> this works perfectly, despite the fact demo.so, to my point of view,
> should not be necessary to read a tree containing basic data types.

Using version 3.03, you should be able to read/query a file containing
classes and not only basic data types, even if you do not have the
original class library.
> 
> Now, I have some code in lib1.so that I would 
> like to reuse in lib2.so. I tried to load these libraries in different
> orders, to link lib1.so as a module inside lib2.so, but nothing works. I'm
> afraid this is because 2 dictionnaries are conflicting.

if lib2 depends on lib1, you should load lib1 first. I cannot tell you
more without looking at your classes.

> 
> One could argue that I may use unsplit mode so I get the objects from
> lib1.so as is inside the tree. I do not want to do that for 2 reasons : I
> prefer to keep the data independant from the source code by using basic
> types, and I like to be able to issue complex TTree::Draw commands
> to have a first look at the data. 

I repeat: You can analyze a Tree containing classes, even if you do not
have the original class library.

Rene Brun


> 
> Is there a way to solve this problem without duplicating the source files
> of lib1 to compile and link them in lib2 ? 
> 
> Many thanks, 
> 
> Colin
> 
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:10 MET