Hi,
I am following this link to understand how TSelector work.
root.cern.ch/drupal/content/acc … -tselector
There is no problem till ‘Creating a Data Member’ title. Problem arises when EventSelector.h comes in play !
I don’t know how to link EventSelector.h and EventSelector.C files. I made one makefile and one main.C (See attached files) and linked them all but I am getting following error :
c++ -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/home/kdkulkarni93/products/root-6.02.08/include -c myselector.C
c++ -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/home/kdkulkarni93/products/root-6.02.08/include -c main.C
c++ myselector.o main.o -L/home/kdkulkarni93/products/root-6.02.08/lib -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -o main.x
myselector.o: In function `myselector::IsA() const':
myselector.C:(.text._ZNK10myselector3IsAEv[_ZNK10myselector3IsAEv]+0xd): undefined reference to `myselector::Class()'
myselector.o: In function `myselector::ShowMembers(TMemberInspector&) const':
myselector.C:(.text._ZNK10myselector11ShowMembersER16TMemberInspector[_ZNK10myselector11ShowMembersER16TMemberInspector]+0x11): undefined reference to `myselector::Class()'
myselector.o:(.rodata._ZTV10myselector[_ZTV10myselector]+0x1d8): undefined reference to `myselector::Streamer(TBuffer&)'
collect2: error: ld returned 1 exit status
make: *** [main] Error 1
Please let me know if you can help. Thank you.
P.S. : I have done same thing for a different example having lot of files where makefile is undoubtedly necessary. Was getting the same error there.
myselector.h (4.37 KB)
myselector.C (3.36 KB)
main.C (364 Bytes)