Loading libraries


ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Dear ROOT users,

I am trying to include an external library in ROOT. I can link and compile some code which uses GeographicLib (an externally downloaded library) by the following-
Compile with:

g++ -c -g -O3 -l/usr/local/include example.cpp

and then link with:

g++ -g -o example example.o -L/usr/local/lib -lGeographic

When I try to include a .hpp file into a piece of code I’d like to run, ROOT seems to recognise some functions from the said library, but when I try to execute, I get the following error:

IncrementalExecutor::executeFunction: symbol ‘_ZN13GeographicLib8GeodesicC1Edd’ unresolved while linking [cling interface function]!
You are probably missing the definition of GeographicLib::someFunction(double, double).

I have tried to load the appropriate header file by using

gSystem->Load(“GeogrpahicLib/REQUIRED _HEADER_FILE.hpp”), but I still get the same error.

Any help with what it is that I’m doing wrong?

Thanks in advance!

Try to first: gSystem->Load(“GeogrpahicLib/libGeographic"); // "GeogrpahicLib/" or "/usr/local/lib/"

1 Like

Dear Wile_E_Coyote,

Thanks for the reply. After viewing your answer, I found that I needed to place my libGeographic.so into the my ROOT installation directory within /macros, then used your answer and load

gSystem->Load(“libGeographic”)

which worked!

Thanks for your help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.