Cannot use TGeoManager with TEveManager in compiled mode

Dear all,

I’m writing a code to visualize a root geometry in TEve.

When I run the .C code directly with ROOT, I have absolutely no problem. The TEve window opens and shows my geometry. I create TEve and get the geometry in the following fashion:

auto gEve = TEveManager::Create();

auto gGeo = gEve->GetGeometry("aROOTfile.root");
gGeo->DefaultColors();

However, when I try to compile the code (via CMake), the code doesn’t understand “gGeo->DefaultColors()”, with the following error:

error: invalid use of incomplete type 'class TGeoManager'
   51 |     gGeo->DefaultColors();

In my CMake file I make sure to call ROOT::Eve and ROOT::Geom.

I’m sure it’s a simple solution, but I’m carking my head to make this work. Any help would be more than appreciated. Many thanks in advance.

_ROOT Version: 6.26
_Platform: GNU/Linux, conda environment
_Compiler: GCC 10.4.0


add #include "TGeoManager.h" at the top of your file

1 Like

Okay … please ignore the post!

It’s a big project and I have loads of libraries included. I guess that I forgot that specific one :sweat_smile:

Thanks!

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