Add a class to extend TH1F features

I want to extend features of a histogram by inherit the TH1F class by the CTrack. I defined my class CTrack : public TH1F in CTrack.h and I implement it in CTrack.cpp. I wrote default constructor, copy constructor, I added ClassImp and ClassDef macros. I created LinkDef.h file. After compilation I’ve got libCTrack.so. When I want to use it in ROOT by .L libCTrack.so I have an error:

dlopen error: ./libCTrack.so: undefined symbol: _ZN4TH1F11ShowMembersER16TMemberInspector
Load Error: Failed to load Dynamic link library ./libCTrack.so
*** Interpreter error recovered ***

Can anybody help me?
I attached a very simple version of my class.
CTrack.tar.gz (40.1 KB)

Hi Tomek

Your compilation is not complete.
You have to create an output file for your dictionary and include this in the compilation of the library.
This is the modified Makefile that worked for me (sorry for messing up with your short cuts):

ROOTCFLAGS      := $(shell root-config --cflags)
ROOTLIBS        := $(shell root-config --libs)
ROOTGLIBS       := $(shell root-config --glibs)


CC=g++
CFLAGS = -fPIC
SOURCES = CTrack.cpp 
OBJECTS = $(SOURCES:.cpp=.o)
EXECUTABLE = libCTrack.so

all: cTrackDict.cpp $(OBJECTS) $(EXECUTABLE) 

cTrackDict.cpp: CTrack.h cTrackLinkDef.h
	rootcint -f $@ -c CTrack.h cTrackLinkDef.h
	$(CC) $(CFLAGS) $(ROOTCFLAGS) -c cTrackDict.cpp -o cTrackDict.o

$(EXECUTABLE): $(OBJECTS)
	$(CC) $(CFLAGS) $(ROOTGLIBS) -shared cTrackDict.o CTrack.o $(ROOTCFLAGS) -o $@

.cpp.o:
	$(CC) -c $(CFLAGS) $< $(ROOTCFLAGS) -o $@

clean:
	@rm -f  $(EXECUTABLE) $(OBJECTS) *Dict*

Cheers, Chris

Yes you are right. I forgot, my mistake. Now It works,
Thank you.

PROBLEM SOLVED