Problems with overloading operator<<

Dear experts,

I have a problem when linking a class (it is just a class for log messages) in root with (.L I get no complaints during compilation and linking, but if I try afterwards to print a message via:

gLog << TLog::DEBUG << “some message” << TLog::END

I get the following error:

Error: operator<< not defined for TLog (tmpfile):1:
*** Interpreter error recovered ***

I already tried several pragma links, but unfortunately don’t get it work. Maybe some of you have any suggestions/hints where to find the problem. Using gcc everything works fine.

Many thanks in advance!


TLog.h (1.18 KB)
TLog.C (1012 Bytes)


Because you operator<< are templated, it will be difficult to make it more with the current interpreter (i.e. I recommend you compile the code using gLog by using ACLiC). In order to make it work properly (short of using extremely low level tricks), you would need to explicitly instantiate and explicitly request the dictionary for each of the parameter type you want to support. I.e. add things like:#pragma link C++ function TLog::operator<<(const char*);



many thanks for the fast help. It worked now.