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 Jan 6, 2023
1 parent bf0fb53 commit c7d43de
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 @@ -43,6 +43,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 c7d43de

Please sign in to comment.