# Dictionary not found at run time

**URL:** <https://root-forum.cern.ch/t/dictionary-not-found-at-run-time/60419>\
**Category:** ROOT\
**Tags:** hist, root\
**Created:** [August 5, 2024, 8:23am UTC](https://root-forum.cern.ch/t/dictionary-not-found-at-run-time/60419 "2024-08-05T08:23:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mperrint](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/b9bd4f/32.png) [@mperrint](https://root-forum.cern.ch/u/mperrint)\
**Post date:** [August 5, 2024, 8:23am UTC](https://root-forum.cern.ch/t/dictionary-not-found-at-run-time/60419/1 "2024-08-05T08:23:04Z")

</div>

* * *

Dear experts of ROOT:

I wrote a shared library

> **[Files · sbl · Mathieu Perrin-Terrin / ToyBeamLine · GitLab](https://gitlab.in2p3.fr/mperrint/toybeamline/-/tree/sbl?ref_type=heads)**
>
> Gitlab IN2P3

that contains custom classes (like [`hit.hh`](https://gitlab.in2p3.fr/mperrint/toybeamline/-/blob/sbl/include/hit.hh?ref_type=heads)) for which I generate a dictionary (see [`Makefile`](https://gitlab.in2p3.fr/mperrint/toybeamline/-/blob/sbl/Makefile?ref_type=heads) and [`LinkDef.h`](https://gitlab.in2p3.fr/mperrint/toybeamline/-/blob/sbl/LinkDef.h?ref_type=heads))

I then use this library in executables, for instance [`app/PlotToy.cc`](https://gitlab.in2p3.fr/mperrint/toybeamline/-/blob/sbl/app/PlotToy.cc?ref_type=heads) that loads `TTree` where `vector<vector <hit> >` are stored.  
If I use the code on a server running root version SL7\_v6.20.04 install as a pre-compile library the code runs smoothly.  
Now, if I used on more recent root version like root\_v6.24.04 or root\_v6.32.02 ([precompile version for ubuntu 22.04](https://root.cern/releases/release-63202/)) on my laptop I keep getting this type or error message:

`Warning in <TClass::Init>: no dictionary for class trk is available Warning in <TClass::Init>: no dictionary for class hit is available Error in <TTree::SetBranchAddress>: The class requested (vector<vector<trk> >) for the branch "trks" is an instance of an stl collection and does not have a compiled CollectionProxy. Please generate the dictionary for this collection (vector<vector<trk> >) to avoid to write corrupted data. Error in <TTree::SetBranchAddress>: The class requested (vector<vector<hit> >) for the branch "hits" is an instance of an stl collection and does not have a compiled CollectionProxy. Please generate the dictionary for this collection (vector<vector<hit> >) to avoid to write corrupted data. `

If I add in the executable an object (not used otherwise) that employs some of these custom objects like

`TrkPropMCS* trkProp = new TrkPropMCS("/home/mperrint/Analysis/Tagging/ToyBeamLine//dat/NA62/beam4-NA62.cfg");`

that uses `track`, then the code runs and is able to find the dictionary.

Would you have any idea on what could cause the executable to not find the dictionnay at run time when I don’t include those useless classes?

thanks in advance,

mathieu

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [August 5, 2024, 8:41am UTC](https://root-forum.cern.ch/t/dictionary-not-found-at-run-time/60419/2 "2024-08-05T08:41:56Z")

</div>

Maybe @pcanal can help

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [August 5, 2024, 4:54pm UTC](https://root-forum.cern.ch/t/dictionary-not-found-at-run-time/60419/3 "2024-08-05T16:54:32Z")

</div>

Ubuntu 22 switched the linker default to the setting where it discard seemingly “unused” library. By adding usage of " those useless classes" you work around this setting.  
You can also use `-Wl,--no-as-needed` to avoid the linker from dropping libraries that are not directly used.

---

<div class="post-metadata">

**Author:** ![mperrint](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/b9bd4f/32.png) [@mperrint](https://root-forum.cern.ch/u/mperrint)\
**Post date:** [August 6, 2024, 7:26am UTC](https://root-forum.cern.ch/t/dictionary-not-found-at-run-time/60419/4 "2024-08-06T07:26:39Z")

</div>

Thank you so much, the problem is fixed!

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [August 20, 2024, 7:27am UTC](https://root-forum.cern.ch/t/dictionary-not-found-at-run-time/60419/5 "2024-08-20T07:27:37Z")

</div>

Closed on August 20, 2024, 7:27am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
