In your “test.C”, try to use: // ...
class TMyRootEvent;
#if !defined(__CINT__)
#include "TMyRootEvent.hpp"
#endif /* !defined(__CINT__) */
//...
void test() {
if (!TClass::GetDict("TMyRootEvent")) {
gROOT->ProcessLine(".L TMyRootEvent.hpp++");
}
// ...
}
See also [url=https://root-forum.cern.ch/t/adding-classes-in-aclic/15817/2 post[/url] (it deals with exactly the same type of problems as you have now).