Hello Root Support,
I am having some trouble understanding how to properly compile a program which incorporates a class that extends off TObject.
I have a custom class which extends off of TObject called CoreasEvent. Within my main program, I read a tree that stores this custom class. My classes are able to compile into object files just fine, but the problem arises when I attempt to link the objects and create an executable. Attempting to do so results in the following errors:
g++ -O vector.o assa.o `/u/osgstorage/anita/root/bin/root-config --glibs` -o assa.exe
assa.o: In function `__static_initialization_and_destruction_0':
~/scripts/assa/assa_root/assa.cc:45: undefined reference to `CoreasEvent::CoreasEvent()'
assa.o: In function `getCRSignal(TTree*, double, double, double, double, double, double, double, double, double, double, double, std::vector<double, std::allocator<double> >&)':
~/scripts/assa/assa_root/assa.cc:811: undefined reference to `CoreasEvent::getOffAngles()'
collect2: ld returned 1 exit status
make: *** [assa.exe] Error 1
The second error especially confuses me because I have confirmed getOffAngles is indeed a function of CoreasEvent.
Another question: what is the difference between using a shared library generated by running .L myclass.cc+ and manually creating your own dictionary using rootcint and a Linkdef file?
Any help would be appreciated, thank you!