I have a compiled shared library [libinsert.so] which includes a header file [calo.h]. When I load the shared library and include the header file in CINT, and made changes to a variable in the header file, the print function in the shared library doesn’t catch the change. Here is the smallest
script I created. calo.h (130 Bytes) insert.C (146 Bytes) insert.h (53 Bytes)
Unfortunately, class also doesn’t work. The problem is not the calo.h itself. The problem is the insert.C. When compiled, looks like it keeps a local version of calo.h in the shared library, which makes it fail to catch the changes made in CLING.
@ferhue I assume that if a “global variable” is defined in a “named namespace” then its value should be “shared”. But, if it is defined in an “unnamed namespace”, then it should be “local” (“static”) to every unit that includes the file with its definition. Maybe one should check what the current C++ standard says about it.