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 - 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");