TClass::LoadClassInfo error for namespace

We have several enums defined in several namespaces. We also have classes with data members whose types are those enums. This code is compiled into a library along with a bunch of other code that we have no problem using within ROOT.

Since ROOT6, when we store these classes containing the enums into trees and save the trees into files and then open the files in root and start accessing the data in the trees, we always get errors like

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

How can we eliminate these error messages? They are driving us crazy.

Please see the attached tarball with code that will reproduce the error message with the minimal amount of code I could muster. Unpack and do

make
./test
root file.root
[1] tree->Show(0)

The Makefile might be specialized to my Mac but hopefully you guys can get it running still if you are on another system with minor obvious changes.

Best,
Jason
NSEnumError.tar.gz (874 Bytes)

Hi Jason,

first of all thanks a lot for the complete reproducer.
Now, I am trying this with master on ubuntu and can’t reproduce. I can certainly try other root versions: what are you using?

Cheers,
D

Hi Jason,

one thing you can do to restore correct behaviour with minimal memory consumption is to modify your linkdef and directly select the enumerator:

...
#pragma link C++ enum  myns::myenum;
...

Cheers,
Danilo

Dear Danilo,

Thank you for the fast response.

I’m running root 6.06.04 on my Mac. However I also see the error when I run my example code on our computing cluster running root 6.06.08 on scientific linux. I’ve attached the Makefile edits I needed for that cluster in case it helps.

Your suggested change did indeed remove the error, on both my Mac and our linux cluster. Interestingly, though, I found that if I added back in the original line so that LinkDef.h contains -both- lines

#pragma link C++ namespace myns;
#pragma link C++ namespace myns::myenum;

then the error comes back:

Error in TClass::LoadClassInfo: no interpreter information for class myns is available even though it has a TClass initialization routine.

And this is the case on both my Mac and our linux cluster.

Thanks,
Jason

Sorry - one more piece of information: I missed that “namespace” was replaced with “enum” in the pragma’s. I’ve now done a few more tests:

#pragma link C++ namespace myns;
–> gives “Error in TClass::LoadClassInfo: no interpreter information for class myns is available even though it has a TClass initialization routine.”

#pragma link C++ namespace myns::myenum;
–> no error

#pragma link C++ enum myns::myenum;
–> no error

#pragma link C++ namespace myns;
#pragma link C++ enum myns::myenum;
–> no error

#pragma link C++ namespace myns;
#pragma link C++ namespace myns::myenum;
–> gives “Error in TClass::LoadClassInfo: no interpreter information for class myns is available even though it has a TClass initialization routine.”

This behavior is identical on my Mac running root 6.06/04 and on our scientific linux cluster running root 6.06/08.

Thanks,
Jason

Hi Jason,

the correct way to tackle this is

...
#pragma link C++ enum  myns::myenum;
...

Cheers,
Danilo

Hi Jason,

#pragma link C++ namespace myns; --> gives "Error in <TClass::LoadClassInfo>: no interpreter information for class myns is available even though it has a TClass initialization routine." This problem should be already fixed in the master and the tip of the v6.06 patch branch (so in the upcoming v6.08/00 and v6.06/10).

Cheers,
Philippe.

Hi Jason, Philippe,

this explains why I had issues reproducing it:great it’s gone!
Now, in the most performant way to make enumerators available to the ROOT type system without requiring any operation such as header parsing, is to select them explicitely with the syntax

...
#pragma link C++ enum  myns::myenum;
...

in the Linkdef file.

Cheers,
Danilo

I still run into this issue when I run the example on

| Welcome to ROOT 6.16/00 https://root.cern |
| © 1995-2018, The ROOT Team |
| Built for linuxx8664gcc on May 30 2019, 17:25:00 |

From tag , 23 January 2019

g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.7.1908 (Core)
Release: 7.7.1908
Codename: Core

make
./test
echo ‘tree->Show(0)’ | root libMyClass.so file.root
Processing libMyClass.so…
Attaching file file.root as _file0…
(TFile ) 0x21e4d60
Error in TClass::LoadClassInfo: no interpreter information for class myns is available even though it has a TClass initialization routine.
======> EVENT:0
mc = (MyClass
)0x22956d0
fUniqueID = 0
fBits = 33554432
fE = 2

Here is my modification of the above code so that it compiles and runs on CentOS7
NSEnumError_RHL.tar.gz (890 Bytes)

on ROOT5 if you say "#pragma link C++ namespace some_namespace;
then all of its contents are visible to the interpreter, as the following example shows:
ROOT 5.34/36 (v5-34-36@v5-34-36, Apr 05 2016, 10:25:45 on linuxx8664gcc)
CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 201
NSEnumError_RHL_ROOT5.tar.gz (878 Bytes) (modified to use rootcint for ROOT5)
make
./test
echo ‘gSystem->Load(“libMyClass.so”); TFile f=new TFile(“file.root”,“r”); ((TTree)f->Get(“tree”))->Show(0)’ | root
======> EVENT:0
mc = (MyClass*)0x16414f0
fUniqueID = 0
fBits = 33554432
fE = 2
produces the result without complaining.