gROOT->FindClass("TVector3") from small CPP program

Hi,
I’ve got a very small CPP program (on Windows) that basically does “TClass::GetClass(“TVector3”);” - it returns null. From the CINT command line it works. Further, if I load in the libPhysics dll then it works.

So, it is as if “auto-loading” is not working. What do I need to do to get it working?

BTW, I’ve tested and it works just fine with other things like TROOT - things that are in libCore, which I’m linking against anyway.

Now, I’ve also found that gROOT->ProcessLine("#include “TVector3.h”") will fix the issue - and causes ROOT to auto-load the libPhysics library. But I’m not sure how I know that TVector3 matches up with libPhysics? In most cases that will work just fine, but not for things like TH1, etc. (for what I’m doing the TVector3 is not hardcoded - a user at run-time can decide on what they want to include).

Another thing that sort-of works is calling ProcessLine with “TVector3 *bogus”… that seems to cause the auto-load to work. I suppose I can do this, but that means messing up the CINT namespace with lots of random names…

Is there a way to get auto-loading to work in this situation?

Many thanks in advance!

Hi Gordon,

do you have a TApplication object? That calls TCint::EnableAutoLoading() - without that call there’ll be no autoloading.

Cheers, Axel.

Thanks Axel.

I don’t have it. Further, when I did add there was no difference. And when I call that ProcessLine it does the auto-loading even though I’ve not called the TApplication. I can test again with the Autoloading.

Hi Gordon,

do you call the argc, argv constructor of TApplication? If you do then can you send a stand-alone example that sets up TApplication and still doesn’t manage to autoload?

Cheers, Axel.