Skip to content

Commit

Permalink
[root6] StBFChain: Declare global pointer to chain in compiled code
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
plexoos committed Dec 10, 2022
1 parent 633cb92 commit ba614cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions StRoot/StBFChain/StBFChain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
TableImpl(Bfc);
ClassImp(StBFChain);

StBFChain *chain = nullptr;

//_____________________________________________________________________________
// Hack constructor.
/*!
Expand Down
5 changes: 4 additions & 1 deletion StRoot/macros/bfc.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ba614cb

Please sign in to comment.