How to add namespace into dictionary

Dear rooters,

I am trying to add some namespaces to the dictionary by following the users guide. My LinkDef.h looks like:

#ifdef __MAKECINT__
#pragma link C++ class XObject+;
#pragma link C++ namespace XAux+;
#pragma link C++ namespace XUnit+;
#pragma link C++ nestedclass;
#pragma link C++ nestedtypedef;
#endif

after compiling, I can find XObject, XAux, XUnit in the dictionary .h and .cc files, and in CINT, XObject can be recognized and properly highlighted. However, XAux and XUnit cannot.

I attached the codes to this post, hope you can repeat my problem as follows:

tar xfvz xman.tar.gz

cd xman

make clean install

export LD_LIBRARY_PATH=/path/to/xman/lib:$LD_LIBRARY_PATH

root

ROOT[1] XObject a;
ROOT[2] XAux::SetStyle();

could you please tell me where I am doing wrong?

Cheers, Jing

Hi,

this is the expected behavior. Autoloading of libraries only works when triggered from a class (like XObject), not from a namespace which are often spread over many libraries. Once you load the library e.g. with gSystem->Load(“libXMan”) or XObject a, XAux and XAux::SetStyle() will be known.

Cheers, Axel.

Dear Axel,

thanks for clarifying it. It bothered me for a while.

Cheers, Jing