Undefined symbol when using macro code in Selector

Hi,
I have a TSelector based analysis, and I would like to include the attached code (and then use it).
I have
#include “checkOQ.C” in my TSelector.C file, but the methods are not yet invoked. I get this error:
/usr/lib/…/lib/crt1.o: In function _start': (.text+0x18): undefined reference tomain’
/mnt/nfs1/epp/data/atlas/sm442/SusySelector/./SimpleSelector_C_ACLiC_dict.o: In function __static_initialization_and_destruction_0(int, int)': SimpleSelector_C_ACLiC_dict.cxx:(.text+0x64c85): undefined reference toROOT::GenerateInitInstance(egammaOQ const*)’
/mnt/nfs1/epp/data/atlas/sm442/SusySelector/./SimpleSelector_C_ACLiC_dict.o: In function egammaOQ::IsA() const': SimpleSelector_C_ACLiC_dict.cxx:(.text._ZNK8egammaOQ3IsAEv[egammaOQ::IsA() const]+0x13): undefined reference toegammaOQ::Class()’
/mnt/nfs1/epp/data/atlas/sm442/SusySelector/./SimpleSelector_C_ACLiC_dict.o:(.data.rel.ro._ZTV8egammaOQ[vtable for egammaOQ]+0xe8): undefined reference to egammaOQ::ShowMembers(TMemberInspector&, char*)' /mnt/nfs1/epp/data/atlas/sm442/SusySelector/./SimpleSelector_C_ACLiC_dict.o:(.data.rel.ro._ZTV8egammaOQ[vtable for egammaOQ]+0xec): undefined reference toegammaOQ::Streamer(TBuffer&)’
collect2: ld returned 1 exit status
*** Interpreter error recovered ***
Error in TSelector::GetSelector: file SimpleSelector.C+O does not have a valid class deriving from TSelector

Note that the file works fine if loaded as:
root -l
.L checkOQ.C++;
egammaOQ myOQ;
myOQ.initialize();
myOQ.checkOQClusterPhoton(152209, 0.6, 1.2);

Thanks in advance,
Stewart Martin-Haugh
checkOQ.C (20 KB)
checkOQ.C (20 KB)

Hi,

probably need to load the library containing the class egammaOQ before you can load SimpleSelector.C.

Cheers, Axel.

Hi,
I have a macro file Chain.C

Chain() {
gSystem->Load("/epp/data/atlas/sm442/SusySelector/checkOQ.so");
gSystem->Load("./checkOQ.so");
gSystem->Load(“checkOQ.so”);
///

chain->Process(“Selector.C+O”);
}
root Chain.C does not work, it can’t find the library in any of these cases:
Error in TUnixSystem::DynamicPathName: checkOQ.so does not exist in /cm/shared/apps/ATLAS/ATLASLocalRootBase/x86_64/root/5.26.00-slc5-gcc4.3-i686/lib:/cm/shared/apps/ATLAS/ATLASLocalRootBase/x86_64/root/5.26.00-slc5-gcc4.3-i686/lib:/cm/shared/apps/ATLAS/ATLASLocalRootBase/x86_64/python/2.5.2-i686/lib:/cm/shared/apps/ATLAS/ATLASLocalRootBase/x86_64/Gcc/gcc432_x86_64_slc5/slc5/gcc43/lib64:/cm/shared/apps/ATLAS/ATLASLocalRootBase/x86_64/Gcc/gcc432_x86_64_slc5/slc5/gcc43/lib:/usr/local/lib::.:/cm/shared/apps/ATLAS/ATLASLocalRootBase/x86_64/root/5.26.00-slc5-gcc4.3-i686/lib:/cm/shared/apps/ATLAS/ATLASLocalRootBase/x86_64/root/5.26.00-slc5-gcc4.3-i686/cint/cint/stl

When running interactively it works OK. How should I load it?

I should probably add that I’ve definitely made the library, using .L checkOQ.C++

Hi,

the library would be called checkOQ_C.so. “ls” should show.

Cheers, Axel.

Silly mistake, thanks for picking it up!

It works now. Thanks again.