# gInterpreter not initialized

**URL:** <https://root-forum.cern.ch/t/ginterpreter-not-initialized/31379>\
**Category:** Newbie\
**Created:** [October 31, 2018, 2:53pm UTC](https://root-forum.cern.ch/t/ginterpreter-not-initialized/31379 "2018-10-31T14:53:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnugent](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@jnugent](https://root-forum.cern.ch/u/jnugent)\
**Post date:** [October 31, 2018, 2:53pm UTC](https://root-forum.cern.ch/t/ginterpreter-not-initialized/31379/1 "2018-10-31T14:53:21Z")

</div>

Dear ROOT developers,

I am trying to build a software package put together by my colleague. I have successfully built the package however it segfaults when I run it. The software is built using ROOT and the stack trace appears to point to some conflict in the way these libraries are being used. I have attached the complete stack trace to this issue.  
[log.txt](https://root-forum.cern.ch/uploads/default/original/3X/c/3/c33d9c68a4c142368b8d4934f51034fe931678f8.txt) (63.7 KB)

versions  
ROOT: 6.12.06  
Linux version 3.10.0-862.14.4.el7.x86\_64 (gcc version 4.8.5 20150623  
(Red Hat 4.8.5-28) Centos7

The software that I am using is here: [https://github.com/patha325/NewSaRoMaN/tree/master/B4c](https://github.com/patha325/NewSaRoMaN/tree/master/B4c) however it requires several items of third party software in order to run so I have not been able to put together a minimal working example. The offending piece of code is here: path/to/NewSaRoMaN/B4c/src/B4PrimaryGeneratorAction.cc at line 112.

I am unsure how to diagnose the error in this segfault though it appears to come from a conflict during running when passing the tuple format NtpMCEventRecord between ROOT and genie. If you could offer any insight or pointers that I could investigate it would be greatly appreciated.

Please let me know if there is any more information that I can add that would help diagose this issue.

Thank you for all of your help,  
John Nugent

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [October 31, 2018, 4:30pm UTC](https://root-forum.cern.ch/t/ginterpreter-not-initialized/31379/2 "2018-10-31T16:30:20Z")

</div>

Hi John,

You’re linking against libCore twice, [https://github.com/patha325/NewSaRoMaN/blob/master/B4c/CMakeLists.txt#L54](https://github.com/patha325/NewSaRoMaN/blob/master/B4c/CMakeLists.txt#L54) :

```auto
set(dummy Core RIO ...)

target_link_libraries(exampleB4c ${dummy} ${dummy} GBase)

```

That’s not a good idea. You’ll instead need to sort out the library dependency and get the order right. We have a CMake snippet that helps here (for the ROOT libraries!); see [https://root.cern.ch/how/integrate-root-my-project-cmake](https://root.cern.ch/how/integrate-root-my-project-cmake)

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![jnugent](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@jnugent](https://root-forum.cern.ch/u/jnugent)\
**Post date:** [November 1, 2018, 5:50pm UTC](https://root-forum.cern.ch/t/ginterpreter-not-initialized/31379/3 "2018-11-01T17:50:53Z")

</div>

Hi Axel,

thank you for your reply. I followed the instructions on the page that you provided the link to and have attached my updated CMakeLists.txt file. [CMakeLists.txt](https://root-forum.cern.ch/uploads/default/original/3X/a/2/a219c3ddce078ec3d4b654727ae1d0014db7d9a9.txt) (3.5 KB)

I have tried placing the ${ROOT\_LIBRARIES} in the target\_link\_libraries before all other libraries, in the middle of the list and at the end and in each case I get the same segfault as I reported above.

Am I missing something else?

Cheers,  
John

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [November 2, 2018, 8:47am UTC](https://root-forum.cern.ch/t/ginterpreter-not-initialized/31379/4 "2018-11-02T08:47:53Z")

</div>

Hi John,

Interesting. Could you create a `TApplication app("app", &argc, argv);` object in your `main(int argc, const char** argv)`?

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![jnugent](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@jnugent](https://root-forum.cern.ch/u/jnugent)\
**Post date:** [November 2, 2018, 9:07am UTC](https://root-forum.cern.ch/t/ginterpreter-not-initialized/31379/5 "2018-11-02T09:07:25Z")

</div>

Hi Axel,

I have included the line

```auto
TApplicaton app ("app", &argc, argv);

```

as the first line in the main function and I have attached the error log that is return when I run the script. [log.txt](https://root-forum.cern.ch/uploads/default/original/3X/7/9/7938088351ac198238fa608ad0e4595ec4ce66cf.txt) (108.6 KB)

Cheers,  
John

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [November 7, 2018, 7:02am UTC](https://root-forum.cern.ch/t/ginterpreter-not-initialized/31379/6 "2018-11-07T07:02:42Z")

</div>

Hmm. Would you have a reproducer - the minimal program (its source) that reproduces this issue? Can you reduce your code, stripping away the parts that I likely don’t have and that are not strictly needed to show the error?

Cheers, Axel.
