Error when executing a program with ROOT as a C++ library: Error in <TClass::LoadClassInfo>: no interpreter information

Describe the problem

I compiled a very simple C++ code with ROOT as a C++ library and obtained an error when executing it:
Error in <TClass::LoadClassInfo>: no interpreter information for class TH1D is available even though it has a TClass initialization routine.

To Reproduce

The source code

#include <TFile.h>
#include <TH1D.h>

int main( int argc, char* argv[] )
{

  TFile* tf = new TFile( "dummy.root", "READ" );
  TH1D* hist = new TH1D( "hist", "title", 100, 0, 100 ) ;
  return 0;
}

dummy.root (431 Bytes)
Any ROOT file is okay to reproduce this problem as far as I can see.

Compiling

g++ `root-config --cflags` `root-config --libs` sample.cc

What I got when executing it

[genki 19:50:28 temp] $ ./a.out
Error in <TClass::LoadClassInfo>: no interpreter information for class TH1D is available even though it has a TClass initialization routine.

Expected behavior

I think the code should show no error.
If I change the following part

  TFile* tf = new TFile( "dummy.root", "READ" );
  TH1D* hist = new TH1D( "hist", "title", 100, 0, 100 ) ;

to

  TH1D* hist = new TH1D( "hist", "title", 100, 0, 100 ) ;
  TFile* tf = new TFile( "dummy.root", "READ" );

, the error doesn’t appear.

Setup

ROOT v6.30/02
Built for macosx64 on Jan 29 2024, 01:08:11
From heads/master@tags/v6-30-02
With Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Binary directory: /Users/genki/soft/ROOT/6.30.02/install/bin

I built ROOT by myself. The compiler is

[genki 19:57:23 temp] $ g++ --version
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Another setup

I could reproduce the problem with another setup

ROOT v6.26/06
Build for linuxx8664gcc
With ??? (unknown compiler since I didn't prepare it)

The compiler I used was

[nukazuka@sphnx03 20:12:24 ~] $ g++ --version
g++ (GCC) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Dear Genki,

Thanks for reporting!
We are looking into this.

Cheers,
D

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