Hi Tareq, there are two solutions to your problem: 1) include A.h in B.h and vice versa (if needed) 2) specify A.h on the rootcint command line when generating DictB.* and vice versa (if needed) Formally 1) is overkill since a forward declaration would be enough, but it is easier to manage. 2) is the correct solution but requires some A.h to be specified in the libB Module.mk. Cheers, Fons. Tareq AbuZayyad wrote: > > Hi, > > I am trying to build a ROOT based application and could use some help > with compiling > the rootcint generated "dictionaries" > > I have a number (50+) of classes and a few executable programs which > currently reside in > a single directory. I use one Makefile to build a shared library from > all the classes (after calling > rootcint to generate the class streamers, ... ). To build executables I > have separate Makefiles > which link the main program with the library. > > I would like to do some code organization by grouping related classes in > subdirectories, generate > separate dictionaries/libraries for each set of classes and finally put > each executable in its > own directory. To do that I've decided to write a main Makefile and a > set of "Module.mk" > files. Here, I am "programing by example" as I do not have much > experience with make; I followed > along the ROOT system Makefile/Modules ( written by Fons Rademakers ) > and made changes > and modifications to suit my particular needs. > > The problem I face now is how to compile the dictionary generated for > one set of classes > which uses functions (streamers) for classes from a separate dictionary. > > Here is an example: > classes A and B are defined in separate subdirectories sub1 and sub2 > class B has a pointer to an object of class A as a data member. > when rootcint is called for each set of classes in a subdirectory it > will > generate separate files ( DictA.h, DictA.C; DictB.h, DictB.C ) > > This means that the streamer for class B has to call (default behavior) > the streamer > for class A. However, the declaration for the streamer of the class A > streamer resides > in DictA.h and is not known in DictB.C where it is being called! > > To build the ROOT system this problem has to be dealt with and it is. > The Makefile > includes a number of utilities and scripts that I would rather not dig > through if I don't > have to. So my question is, do I have to? if so can someone give me > some pointers > where to look? Mind you the process of building my application should be > simpler than > building ROOT since all the ROOT libraries already exist in my case. > > I am running root version 2.26 on line RH 7.0 > > Thank you, > Tareq -- 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 : Tue Jan 01 2002 - 17:50:40 MET