Rootcling dictionary for function

Hi Experts,

I have a header and source files in which I define a class GClient and a function startGClient(const char* s). In the linkdef file, I have

#pragma link C++ class GClient;
#pragma link C++ function startGClient(const char*);

Both are linked in the library

If I start root and load the library, trying to call startGClient(“a”), gives an error:

[] startGClient("a")
input_line_28:2:3: error: use of undeclared identifier 'startGClient'

However, if I first inspect the class GClient, i.e.

[] .class GClient

and then call the function, everything works.

Is there anything I miss? The same worked with cint for years.

Thanks and best regards,


To have the function visible in the prompt you need to parse the header file defining the function.
Just do in the ROOT prompt
root> .L GCClient.h
root>#include “GCClient.h”


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