Dictionary Generation

Hello,
I am trying to generate the dictionary for my class using the receipe mentioned on

root.cern.ch/root/CintGenerator.html

The "GNUmakefile " is following

#---------------------------------------------------
CXXFLAGS = -g +a1 +Z -I$(ROOTSYS)/include
LDFLAGS = -g +a1 -b
LD = CC

HDRS = JPJet.hh JPTrack.hh eventdict.h

SRCS = JPJet.cc JPTrack.cc eventdict.C

OBJS = JPJet.o JPTrack.o eventdict.o

PROGRAM = event.sl

all: $(PROGRAM)
$(PROGRAM): $(OBJS)
@echo “Linking $(PROGRAM) …”
@/bin/rm -f $(PROGRAM)
@$(LD) $(LDFLAGS) $(OBJS) -o $(PROGRAM)
@chmod 555 $(PROGRAM)
@echo "done"
clean:; @rm -f $(OBJS) core

JPJet.o: JPJet.hh
JPTrack.o: JPTrack.hh

eventdict.C: JPJet.hh JPTrack.hh
@echo “Generating dictionary …”
@rootcint eventdict.C -c JPJet.hh JPTrack.hh
#---------------------------------------------------

When I am doing “gmake”, the error I faced

==========================
gmake: *** No rule to make target eventdict.o', needed byevent.sl’. Stop.

Could you please let me know the possible solution for it ?

Thanking you,
Manoj

Hi,

I’d say make is pretty explicit with its error message: you didn’t specify any rule to make the target eventdict.o', which is needed byevent.sl’. As a matter of fact you didn’t specify any rule how to build object files. Check ROOTSYS/test/Makefile; a common line would be

%.o: %.cc $(CXX) $(CXXFLAGS) -c $< -o $@
and the same for .C. And you should use root-config --cflags instead of setting CXXFLAGS yourself and root-config --ld for LD, root-config --cxx for CXX, etc.

Cheers, Axel.

Hi,
Thanks ! It works. The shared library has been created. But I am not able to see the branches of the tree (which has been created by my own custom class). I load the shared lib using the command “gSystem->Load(“event.sl”)” in the root prompt. Then I open the TBrowser. When I am clicking on tree, I am not able to go further down.

Could you please let me know what I would have to do in order to see the branches of tree in a TBrowser ?

Thanks,
Manoj

[quote=“Axel”]Hi,

I’d say make is pretty explicit with its error message: you didn’t specify any rule to make the target eventdict.o', which is needed byevent.sl’. As a matter of fact you didn’t specify any rule how to build object files. Check ROOTSYS/test/Makefile; a common line would be

%.o: %.cc $(CXX) $(CXXFLAGS) -c $< -o $@
and the same for .C. And you should use root-config --cflags instead of setting CXXFLAGS yourself and root-config --ld for LD, root-config --cxx for CXX, etc.

Cheers, Axel.[/quote]

[quote]
Could you please let me know what I would have to do in order to see the branches of tree in a TBrowser ? [/quote]They should appear in your case. Can you post a small .root file as created by your classes?

Thanks,
Philippe

Hi Manoj,

I was able to download your file and I see no problem in the TBrowser. When I bring up the TBrowser, I click on ROOT Files and see your filename.
I double click on the filename and see your TTree name (STNTUPLE). I double click on the tree name and see 2 branches names. I double click on either of those names (JPJet or JPTrack) and see a bunch of leaves. Then I can double click on those leaves and see a new canvas which your data (which looks like this file was created with only ‘default’ values).

I was not able to use your shared library since it was build with some older version of ROOT (and I was unable to guess which :slight_smile: ).

Cheers,
Philippe