LinkDef.h linking functions in namespace


I’m trying to write a package where it can be called from python. There’s a namespace that only has functions. I put it in the LinkDef.h and it compiles fine but when running with the python script by calling one of the function, I get 3/4 occurrences of the following depending on my root version. It happens at 6.18.00, too.

“Error in TClass::LoadClassInfo: no interpreter information for class [namespace] is available even though it has a TClass initialization routine”

The code continues to run fine without seg break. But the messages are a little annoying.

I’ve found this old thread Problem with LoadClassInfo for class instantiated very early saying it’s an order issue for interpreter, so adding the Declare() do remove the messages. Are these the same issues? Does it mean we can only expect it fixed later?

An alternative way I’m doing is to use class instead of namespace, and define the functions as static functions. Users won’t notice the difference when using it. This could be an alternative but it alters the structure of the package a bit.

Here’s the LinkDef.h and the CMakeList file. I changed WSInterface to a class, but MinimizerSetting still have the same issue.
CMakeLists.txt (2.6 KB)
LinkDef.h (2.9 KB)


Hello @RongkunWang,

I invited @Axel to help here.

Hey! Just checking if there’s any updates?

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

Major apologies for this super late reply. You can indeed either use static class functions, or try out master / upcoming v6.20/00, which (for now only on Linux) uses a new mechanism for autoloading that will also resolve functions and load the correct library!

Cheers, Axel.