$ make
g++ -g +a1 +Z -I/usr/include/root -c -o Track.o Track.C
g++: +a1: No such file or directory
g++: +Z: No such file or directory
make: *** [Track.o] Error 1
My ROOT version is:
ROOT 5.18/00b (branches/v5-18-00-patches@22563, Apr 06 2010, 01:56:00 on linux)
CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
I am on ubuntu 10.04. Let me know if you need more information.
Unfortunately it looks like the code on the page you used is for HP-UX. I have no experience with it, but it looks like the compiler options are different from the GNU C++ compiler which is what I assume you are using on Ubuntu. Also HP-UX uses .sl for shared library extension, whereas you probably want to use .so on Ubuntu.
I modified the files and got them to compile on Fedora 13 which should be similar enough to your Ubuntu setup:
After compiling I started ROOT and did gSystem->Load("event.so") to see that it loaded the library and did something like Event *t = new Event() and Track *t = new Track() and saw that it instantiated those objects without complaint.
One odd quirk that I experienced on Fedora 13, that you may not see on Ubuntu was that when I first tried to load the library I got a memory error:
root [0] gSystem->Load("./event.so");
dlopen error: /home/whanlon/tmp/././event.so: cannot restore segment prot after reloc: Permission denied
Load Error: Failed to load Dynamic link library /home/whanlon/tmp/././event.so
*** Interpreter error recovered ***
This is apparently an effect of SELinux preventing users from manipulating memory in a way that may be suspicious. I had to turn off SELinux enforcing to allow the library to load using: sudo setenforce 0. Track.C (541 Bytes) Track.h (668 Bytes) Event.C (682 Bytes) Event.h (607 Bytes)