From c7d43de5f0ae0e65d5cfcaf2243e50be59e070fa Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 22 Nov 2022 22:38:50 -0500 Subject: [PATCH] [root6] StBFChain: Declare global pointer to chain in compiled code It appears that the ROOT6 interpreter prefers to see the declaration of the main StBFChain in the compiled code over the one in the `bfc.C` macro: ``` LoadTable: .L /star-sw/StarDb/AgMLGeometry/Geometry.y2021a.C IncrementalExecutor::executeFunction: symbol 'chain' unresolved while linking [cling interface function]! root4star: .sl79_gcc485/OBJ/StRoot/St_db_Maker/St_db_Maker.cxx:934: virtual TDataSet* St_db_Maker::LoadTable(TDataSet*): Assertion `!ee' failed. ``` Could it be that global variables in interpreted code are not visible in other interpreted scripts? --- StRoot/StBFChain/StBFChain.cxx | 2 ++ StRoot/macros/bfc.C | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/StRoot/StBFChain/StBFChain.cxx b/StRoot/StBFChain/StBFChain.cxx index 708775b5ab5..b2a23202190 100644 --- a/StRoot/StBFChain/StBFChain.cxx +++ b/StRoot/StBFChain/StBFChain.cxx @@ -43,6 +43,8 @@ TableImpl(Bfc); ClassImp(StBFChain); +StBFChain *chain = nullptr; + //_____________________________________________________________________________ // Hack constructor. /*! diff --git a/StRoot/macros/bfc.C b/StRoot/macros/bfc.C index 5082df03028..987607bf989 100644 --- a/StRoot/macros/bfc.C +++ b/StRoot/macros/bfc.C @@ -29,7 +29,10 @@ class StMessMgr; #include "TAttr.h" #include "Rtypes.h" #endif -StBFChain *chain=0; + +// 'chain' is defined in StBFChain library (see StRoot/StBFChain.cxx) +extern StBFChain* chain; + //_____________________________________________________________________ //_________________ Prototypes _______________________________________________ void Usage();