Slot function doesn't work when Compile the code

Dear experts,

I found that when I use interactive ROOT to execute macro which contains TCanvas::HighlightConnect() it works fine, but with the same code (with additional main()) if I compile it first by root-config --cxx --cflags --libs -lMinuit2 then it will give the runtime error message:

Error in <TQObject::CheckConnectArgs>: slot DocaHighlighted(TVirtualPad*,TObject*,int,int) does not exist

why?

Thank you, should I add parameters in the #pragma? Like #pragma link C++ function PosHighlighted(TVirtualPad* pad, TObject* obj, Int_t ihp, Int_t y)+;?

Try

gInterpreter->Declare("void PosHighlighted(TVirtualPad* pad, TObject* obj, Int_t ihp, Int_t y);");

It works! thank you :slight_smile:

1 Like

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