Error in <MPSend>: [E] Could not find cling definition for class


I am working on parallelizing some code.
I use the ROOT::TProcessExecutor class.

In particular, I define a struct called PACK that is used in the parallelized section :
struct PACK{
double _nodtmaxeffs, _dnodtmaxeffs, _maxeffs, _dmaxeffs;
vector _maxincleffs, _dmaxincleffs;

There is no problem at compilation, but when I run the program
I get the following error :

“Error in : [E] Could not find cling definition for class 4PACK”

I am not sure what to do, could somebody help ?

Thanks in advance,


You need to teach cling about the struct. One way is to explicitly load the header file (gInterpreter->LoadFile("PACK.h");) Another way is to generate/request a [ROOT] dictionary for the struct (via rootcling/LinkDef or genreflex/Selection.xml).


I forgot to precise that I have defined the struct PACK in the same file as in the one I use it (simply above the main method); there is no PACK.h header file.
Plus their are some classes defined in the same code file without any associated header file; the difference with PACK is that they inherit from other classes defined in some separate files (for which I include the associated headers).

Moreover the code is compiled and not interpreted. Why would cling be involved ?



Can you provide the smallest sample of your code reproducing the problem?
Also, specify the exact version of ROOT you are working with.

G Ganis

Is PACK one of the structure that is supposed to be shared among the process is order to parallelize your code? If this is the case, in order to transfer the PACK object from one process to another we need to serialize it via ROOT I/O; in order to do we must have a dictionary for PACK.

If this is not the case, the we will really need to see the code in order to understand why it would complain about it (it should not).


I am using ROOT 6.08/06

Yes PACK is a struct that is used in the parallelized section of the code. More specifically, PACK is the return type of the function called in the Map.

How should I proceed to add the PACK struct to dictionnary?


I am sorry, my answer was not accurate enough :
PACK is NOT shared among the process but it is simply the return type of the function to run in parallel.

Moreover, here is some piece of code that provides the exact same issue.

mp_test.cpp (2.4 KB)

I have compiled it using :

$ g++ mp_test.cpp -o mp_test

with the options that come when typing :

$ root-config --cflags --ldflags --libs

I finally tried gInterpreter->LoadFile("PACK.h");
and it worked ! Thank you for your help !!! :+1:

1 Like

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