Unable to compile executable with root 3.10-01 on gcc 2.95.3

Hello,

I get some strange messages when compiling my macro into an executable:

[noric09] /u/br/markhod/Simulation/TauCPAnalysis > gmake -f makefile
Making CINT file
Making CINT object
compiling
/tmp/ccMTnZWb.o: In function TestCode(void)': /tmp/ccMTnZWb.o(.text+0xe): undefined reference toTauStringArray::TauStringArray(void)’
/tmp/ccMTnZWb.o(.text+0x5d): undefined reference to TauStringArray::PushBack(TString const &)' /tmp/ccMTnZWb.o(.text+0xe5): undefined reference toTauCompiledMacros::TauCompiledMacros(void)’
/tmp/ccMTnZWb.o(.text+0x106): undefined reference to TauCompiledMacros::MacroMulti(TauStringArray, TString, TString, TString)' /tmp/ccMTnZWb.o(.text+0x11f): undefined reference toTauCompiledMacros::~TauCompiledMacros(void)’
/tmp/ccMTnZWb.o(.text+0x13a): undefined reference to TauStringArray::~TauStringArray(void)' /tmp/ccMTnZWb.o(.text+0x16a): undefined reference toTauCompiledMacros::~TauCompiledMacros(void)’
/tmp/ccMTnZWb.o(.text+0x17d): undefined reference to TauStringArray::~TauStringArray(void)' /tmp/ccMTnZWb.o: In functionTauStringArray::TauStringArray(TauStringArray const &)’:
/tmp/ccMTnZWb.o(.TauStringArray::gnu.linkonce.t.(TauStringArray const &)+0x11): undefined reference to `TauStringArray virtual table’
collect2: ld returned 1 exit status
gmake: *** [all] Error 1

My makefile has:

HHLIST = $(filter-out TauCPAnalysis_LinkDef.hh,$(wildcard *.hh))
PACKAGE = TauCPAnalysis
CINTOBJ = $(PACKAGE)Cint.o
CINTFILE = $(PACKAGE)Cint.cc
OBJ = *.o
NAME = TestCode
SHAREDOBJ = ./tmp/libMyLib.so

all: $(CINTOBJ) $(OBJ)

@g++ $(patsubst %.cc,%.o,$(CINTFILE)) -shared -o $(SHAREDOBJ)

@g++ -I$(ROOTSYS)/include/ -L$(ROOTSYS)/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lGui -lm -ldl -Ltmp -lMyLib -o ${NAME}.exe ${NAME}.cc $(shell root-config --glibs)

$(OBJ) : *.cc *.C
@echo “compiling”
@g++ -I$(ROOTSYS)/include/ -c *.cc
@ar r libMyLib.a *.o

$(CINTOBJ): $(HHLIST) TauCPAnalysis_LinkDef.hh
@rm -rf $(CINTFILE)
@echo “Making CINT file”
@rootcint -f $(CINTFILE) -c $(HHLIST) TauCPAnalysis_LinkDef.hh
@echo “Making CINT object”
@g++ -c $(CINTFILE) -o $(CINTOBJ) -I$(ROOTSYS)/include

clean:

rm -rf $(CINTOBJ)
rm -rf $(OBJ)
rm -rf $(SHAREDOBJ)

and my macro, TestCode.cc does include TauStringArray and TauCompiledMacros header files, but it seems the compiler still is not satisfied. Does anyone know where I am going wrong?

Thanks,

Mark

Most of the time you get this kind of error when you forget to implement one of the methods in your class.

Also the is no need to specify all ROOT libraries when also using root-config --glibs. Just use only root-config. But this does not change anything concerning your problem.

Cheers, Fons.