How to Compile and Link with the ROOT libraries
The ROOT distribution kit includes a directory root/test with a suite
of test programs to be compiled and linked with the standard
ROOT libraries. This directory includes also a Makefile specific
to each platform to compile and link a given test program. For example,
to generate an executable module of the Event
test program, you execute the shell script command:
make Event
This command will:
- Compile Event.C if it has been modified since the previous make.
- Invoke the rootcint utility in case the Event.h file
has been modified and will compile it.
- Generate the shared library libEvent.so.
- Generate the executable module Event.
To see how this makefile looks on various Unix platforms,
look at Makefile for Unix platforms .
If you run an interactive ROOT session, you can dynamically link
to an existing shared library by executing a command like:
gSystem->Load("libEvent.so");
In addition, you have interactive access to member functions of the classes
that have been processed to rootcint. In the same test directory,
see examples of macros eventa
and eventb. These two macros
execute code from the dynamically linked library libEvent.so.
Rene Brun,
Fons Rademakers
Last update 12/01/97 by Rene Brun