Using BOOST with ROOT

Hello All,

Is there some different install procedure to link the boost libraries with ROOT. I installed boost libraries after installing ROOT and a part of my code looks like this:

#include <lexcal_cast> ... processNumber = boost::lexical_cast<int>(processName);

When I run the above code by calling

I get
AnalyseHits.C:32:23: error: lexcal_cast: No such file or directory

DATA:/media/LaCieHD> ls /usr/include/boost/lexical_cast.hpp

Another reference :



you probably mean “#include <boost/lexical_cast.hpp>”. You must not misspell include file names, be it with or without ROOT :slight_smile: You might also want to surround it by #ifndef CINT#endif because CINT will most probably not be able to parse the boost headers when generating the dictionary (which is part of the “+” procedure).

Cheers, Axel.

Sorry Axel, I made a typing mistake when writing the post. In my real code, I have the correct spelling.

#include <boost/lexical_cast.hpp> ... processNumber = boost::lexical_cast<int>(processName);

any my error message is:

[quote]Error: Symbol G__exception is not defined in current scope :0:
Error: type G__exception not defined FILE: LINE:0
*** Interpreter error recovered ***[/quote]


could you try again after setting “.exception” in CINT? I expect that CINT answers with “G__catchexception=0” which means that it will not catch exceptions anymore. This might give you some more info.

Either way you can attach gdb to root.exe (yes, I mean “root.exe”), type “run” once so you get the error you see, then call “catch throw” (having run your program GDB now knows what to do), and “run” again. Now GDB will break when an exception is thrown.

In short: this is usually a symptom of your program throwing an exception.

Cheers, Axel.