ROOT.gROOT.LoadMacro("myfunc.C") and TMatrix crashes

Hi,

we are trying to use a TMatrix inside a function but we get a crash while loading the function with LoadMacro.
To take an example:

defining test_func.C as:
#include “TMatrixD.h”

int test_TMatrix()
{
TMatrixD m(2,2);
return 0;
}

and then calling it:

import ROOT
ROOT.gROOT.LoadMacro(“test_func.C”)

I get the following crash:
Traceback (most recent call last):
File “”, line 1, in
RuntimeError: (file “/cvmfs/atlas.cern.ch/repo/sw/software/i686-slc5-gcc43-opt/17.3.4/sw/lcg/app/releases/ROOT/5.30.05/i686-slc5-gcc43-opt/root/include/TMatrixTBase.h”, line 93) Invalid type ‘R__EXTERN’ in declaration of 'Int_t gMatrixCheck’
Error: Symbol R__EXTERN Int_t gMatrixCheck is not defined in current scope

The same error does not occur with other classes like TLorentzVector. Could it be some problem like missing library -lMatrix ? Any hint on how to solve our problem ?

Cheers,
Renaud

It works on my machine if I add “+” to the LoadMacro string to make it compile with ACLiC. Without “+” I get the same error message as you.

Jean-François

Hi Jean-François,

Thanks for the answer! I guess the no “+” option should be fixed in future, but this will do the job for now!

Sincerely,
Judita

Hi,

in ROOT6, both with and without ‘+’ will behave the same from the user’s point of view.

Cheers,
Wim