In short, library is not loaded when from outside its native directory.
The sequence of commands triggering the problem is the following (executed from the ROOT command line):
- load my library (.L lib. so)
- load and compile my macro (.L macro.C++)
- When I was working on Linux w/ ROOT,v5, it worked, wheresoever.
- When now on MAC, w/ ROOT,v6, and that takes place from the native directory of my software (where the library has been compiled and is residing), it also works,
- When that takes place from any other directory, it does not work, w/ error message (lib = SimpleDetect and macro = ReadDetDat):
Info in TMacOSXSystem::ACLiC: creating shared library /Users/ybedfer/analysis/root.macros/Alberts_plots/ReadDetDat_C.so
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Users/ybedfer/analysis/root.macros/Alberts_plots/ReadDetDat_C.so, 9): Library not loaded: SimpleDetect.so
Referenced from: /Users/ybedfer/analysis/root.macros/Alberts_plots/ReadDetDat_C.so
Reason: image not found
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
I can add that I had to face a similar problem for loading the library in the first place.
- Worked on Linux, w/ v5 whersoever.
- Works on MAC w/ v6 when from the native directory.
- Does not work from outside the native directory, w/ this time, error message:
Missing FileEntry for SimpleDetect.h
requested to autoload type SimpleDetect
I found the solution on roottalk: have to define a “ROOT_INCLUDE_PATH” environment variable.
Regards,
Yann Bedfer