GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » Problem when using boost libraries
Problem when using boost libraries [message #15597] Fri, 25 October 2013 14:56 Go to next message
Stanislav Poslavsky is currently offline  Stanislav Poslavsky
Messages: 9
Registered: October 2013
Location: Protvino
occasional visitor
From: 194.190.166*
Good day.

I'm working under implementation of a custom generator in PandaRoot and would like to use some boost libraries. All ok, when I use boost::random, but, when I simply try to include

#include <boost/date_time/posix_time/posix_time.hpp>


I have a very long stack of compilation errors with a typical line looking as

Error: G__getvariable: expression  /home/stas/distr/pandaroot/external/build//include/boost/config.hpp:23: 


Same with other boost libraries, like boost::iostreams etc. After some search with google, I found that problems might arise from incompatibilities of boost and CINT preprocessors.

So, is there any way to use boost libraries inside PandaRoot?

Thanks, Stanislav.
Re: Problem when using boost libraries [message #15598 is a reply to message #15597] Fri, 25 October 2013 15:15 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hi,

in your header file:

#if !defined(__CINT__) || defined(__MAKECINT__)
#include <boost/date_time/posix_time/posix_time.hpp>
#endif


Cheers,

Mohammad
Re: Problem when using boost libraries [message #15599 is a reply to message #15598] Fri, 25 October 2013 15:26 Go to previous messageGo to next message
Stanislav Poslavsky is currently offline  Stanislav Poslavsky
Messages: 9
Registered: October 2013
Location: Protvino
occasional visitor
From: 194.190.166*
Thanks!

But what if this condition fails (`__CINT__` is defined and `__MAKECINT__` is not) => #include statement is ignored? How I can use boost libraries in this case?

(I see only one way - compile my library without __CINT__ and make a .so file, then use it as an external complied library - but, I try to find another solution)
Re: Problem when using boost libraries [message #15600 is a reply to message #15599] Fri, 25 October 2013 15:36 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
These are the only conditions which are used in ROOT when CINT is processing your class or create a dictionary for it. You can also put the boost includes only in your implementation files to avoid this! in any case in the near future will get rid of CINT completely!

Cheers,
Mohammad
Re: Problem when using boost libraries [message #15601 is a reply to message #15600] Fri, 25 October 2013 15:41 Go to previous message
Stanislav Poslavsky is currently offline  Stanislav Poslavsky
Messages: 9
Registered: October 2013
Location: Protvino
occasional visitor
From: 194.190.166*
It works! When I put #include only in .cxx all goes fine.

Many thanks,
Stanislav
Previous Topic: STTHits with errors
Next Topic: external packages apr13 - installation note
Goto Forum:
  


Current Time: Mon Nov 25 13:37:44 CET 2024

Total time taken to generate the page: 0.00888 seconds