Could you please help me about the Makefile
Sorry for this dump question but I really have no idea for Makefile.
And I guess the problem must be from my Makefile.
I tried to get my class compiled but i still keep getting the error message which complaining about TFile TH1D not defined in current scope ( those TObjests but I do include TObject.h )
ps1. Basically, I followed Ch15 of user guide and it can be run by ACLiC
ps2. my system is ubuntu 8.10
Thank you very much!
SC
This is my Makefile #---------------------------------------------------
CXX = g++
CXXFLAGS = -O -Wall -fPIC -shared
LD = g++
LDFLAGS = -g
SOFLAGS = -shared
[quote]I tried to get my class compiled but i still keep getting the error message which complaining about TFile TH1D not defined in current scope ( those TObjests but I do include TObject.h )
[/quote]
You need to include TH1D.h
I’ve tried that …it still throw out the same error message(not only TH1D…all TObjects it doesn’t like …) and that’s why I guess I didn’t get the Makefile right.
Besides, I also tried that setting my codes in root/ or root/mypackage but it doesn’t work …
Cheers,
SC
[quote=“pcanal”][quote]I tried to get my class compiled but i still keep getting the error message which complaining about TFile TH1D not defined in current scope ( those TObjests but I do include TObject.h )
[/quote]
You need to include TH1D.h
========error message===========
sckao@sck:~/root/MyAnalysis$ make
Generating dictionary: masstmplibdict.cc
from: MassTemplate.h LinkDef.h
/home/sckao/root/bin/rootcint masstmplibdict.cc -c MassTemplate.h LinkDef.h
Linking masstmplib.so …
g++: masstmplib.so: No such file or directory
masstmplibdict.cc:7:37: error: RConfig.h: No such file or directory
In file included from masstmplibdict.cc:16:
masstmplibdict.h:18:24: error: cint/G__ci.h: No such file or directory
masstmplibdict.h:31:21: error: TObject.h: No such file or directory
masstmplibdict.h:32:30: error: TMemberInspector.h: No such file or directory
In file included from masstmplibdict.h:33,
from masstmplibdict.cc:16:
MassTemplate.h:5:18: error: TH1D.h: No such file or directory
MassTemplate.h:6:18: error: TH2D.h: No such file or directory
MassTemplate.h:7:21: error: TCanvas.h: No such file or directory
MassTemplate.h:8:19: error: TFile.h: No such file or directory
masstmplibdict.cc:18:20: error: TClass.h: No such file or directory
masstmplibdict.cc:19:21: error: TBuffer.h: No such file or directory
masstmplibdict.cc:21:20: error: TError.h: No such file or directory
…
[quote=“pcanal”]Hi,
What is the compile line issued by your makefile when compiling your source file? What is the exactfirst error message you see?
SC: your line
@$(LD) $(CXXFLAB) $(LIB) -o $@ $^
has two bugs, it should be
@$(LD) $(CXXFLAGS) -o $@ $^
Tom: the link line is wrong; it should be
$(CXX) $(LDFLAGS) $(SOFLAGS) $(CXXFLAGS) MyLibDict.cc -o $@
The CXX vs LD doesn’t matter in your case but you need to pass CXXFLAGS because compiling the .cc is one of the steps you request the compiler driver to do.
Thanks for the quick response. From my side, things now work
There’s just one more change I needed to implement, which I’ll include here for posterity. For the case of my files, which include different types of map objects I want to use, I needed to make the following edit to my Makefile: