Question about loading libraries

I have a library containing a class that uses and manipulates TViews internally for a canvas. If I try to load the library in root I get an error because it cannot find various symbols. A problem which is solved by creating a canvas first in root, then trying to load the library. We pretty much always use TCanvas etc so I was wondering if there was an elegant way for me to make sure all the libraries needed by the TCanvas object are linked against when I start root.

thanks

Will

TView is in libGpad. You must link your library with libGpad or alternatively dynamically link libGpad at run time with:
gSystem->Load(“libGpad”);

You can find the library where a class is implemented by looking at the top right corner of the class documentation in the Reference Guide.
For example for TView
root.cern.ch/root/html/TView.html

Rene

Thanks for responding Rene.

I already understand about loading libraries in root, but in this case, if you run the root executable you need to load a few libraries to get TCanvas working, more than GPad. If I run in gdb and make a TCanvas I see the verbose feedback indicating that six dylibs were loaded.

I came up with an elegant solution though. I made my own root executable which used my library. When I run that version of root then all the libraries I need for TCanvas and my own libraries are pre loaded.

thanks for your time

Will