Can't compile derived class from MakeSelector()

Hi everybody!

I’m trying to compile a class, which is derived from a class which is generated via the MakeSelector() method, but somehow I don’t succeed.

So, in principal, I’m doing

If I run it with

everything’s fine.
But I want to use a class, which is derived from this class, so I have a class “myClass.C” which looks like that

#include "generatedClass.h" class myClass : public generatedClass { public : myClass () : generatedClass() { }; }
If I try to run that, I get an error which says:

Someone knows, what I’m doing wrong?
I don’t really understand that, because generatedClass is derived from TSelector and myClass is derived from generatedClass, so myClass should also be derived from TSelector, or not?

Cheers,
Christian

Hi.

ACLiC only generate the dictionary for the class with the same name as the file and hence ROOT knows about ‘myClass’ but does not known about ‘generatedClass’. Use:

#include "generatedClass.C" class myClass : public generatedClass { public : myClass () : generatedClass() { }; } #ifdef __MAKECINT__ #pragma link C++ class generatedClass+; #endif

Cheers,
philippe.

Hi Philippe and thanks for your answer!
Make sense, what you’re saying, but this #pragma line doesn’t seem to help - I still get the same error message.
But I found out, that it works, if I load and compile the base class before. So these lines now work for me:

.L generatedClass.C+ Tree->Process("myClass.C+")