# Straight line through TH3

**URL:** <https://root-forum.cern.ch/t/straight-line-through-th3/39104>\
**Category:** Newbie\
**Created:** [April 26, 2020, 5:21pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104 "2020-04-26T17:21:56Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![juliangb](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/juliangb/32/21448_2.png) [@juliangb](https://root-forum.cern.ch/u/juliangb)\
**Post date:** [April 28, 2020, 6:07pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/21 "2020-04-28T18:07:21Z")

</div>

When I run `root-config --config` it returns the text in this archive: [rootconfig.cc](https://root-forum.cern.ch/uploads/short-url/jrp2Qdl7eV69mP1W9ooum4lkLfu.cc) (2.9 KB) , which shows that `OPENGL_gl_LIBRARY=/usr/lib/x86_64-linux-gnu/libGL.so` is already present, so I assume it should be available.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 28, 2020, 6:14pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/22 "2020-04-28T18:14:27Z")

</div>

`root-config --features`

---

<div class="post-metadata">

**Author:** ![juliangb](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/juliangb/32/21448_2.png) [@juliangb](https://root-forum.cern.ch/u/juliangb)\
**Post date:** [April 28, 2020, 6:42pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/23 "2020-04-28T18:42:21Z")

</div>

It returns this

`asimage astiff builtin_afterimage builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm`  
`builtin_clang builtin_lzma builtin_lz4 builtin_tbb builtin_vdt builtin_xxhash cling cxx11`  
`exceptions explicitlink fftw3 fitsio gdml genvector http imt mathmore mysql opengl `  
`pch python roofit shared ssl thread tmva tmva-cpu vdt x11 xft xml`

which includes `opengl`.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 28, 2020, 6:57pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/24 "2020-04-28T18:57:13Z")

</div>

Do you try it like this:

```nohighlight
root [0] .L Many3DHistograms_OS.cc
root [1] Many3DHistograms();

```

Do you run ROOT on your local machine?  
If not, so you use “ssh -X -Y”?

---

<div class="post-metadata">

**Author:** ![juliangb](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/juliangb/32/21448_2.png) [@juliangb](https://root-forum.cern.ch/u/juliangb)\
**Post date:** [April 28, 2020, 10:41pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/25 "2020-04-28T22:41:15Z")

</div>

That does work if I run it like that, thanks! But how do I do to make it work if I want to execute it from my own .exe file (made with my Makefile). I’m sorry if it’s a dumb question!

I really appreciate your help, @Wile_E_Coyote @couet and @OSchaile for uploading the code! I could safely say that it’s the one that will solve the original problem.

---

<div class="post-metadata">

**Author:** ![OSchaile](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/e495f1/32.png) [@OSchaile](https://root-forum.cern.ch/u/OSchaile)\
**Post date:** [April 29, 2020, 3:43pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/26 "2020-04-29T15:43:53Z")

</div>

HI,  
not brandnew but still valid:  
[https://root.cern.ch/root/roottalk/roottalk03/5346.html](https://root.cern.ch/root/roottalk/roottalk03/5346.html)  
Otto

---

<div class="post-metadata">

**Author:** ![juliangb](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/juliangb/32/21448_2.png) [@juliangb](https://root-forum.cern.ch/u/juliangb)\
**Post date:** [April 30, 2020, 10:06pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/27 "2020-04-30T22:06:55Z")

</div>

Sorry fot the late response, I found out that I didn’t include the “TGLViewer” object correctly, I’m sorry I didn’t realise it before.

But now, without altering the Makefile, I get the following error when trying to compile my code:

```auto
Many3DHistogramsForum_Compile_BROKEN.o: In function `Many3DHistograms(int, int)':
Many3DHistogramsForum_Compile_BROKEN.cc:(.text+0x11e9): undefined reference to `TGLViewer::DoDraw(bool)'
collect2: error: ld returned 1 exit status
Makefile:15: recipe for target 'Many3DHistogramsForum_Compile_BROKEN.exe' failed

```

When I include the `-L$ROOTSYS/lib -lCore -lCint` in the Makefile, as suggested in the ffirst line in the link you provided, I get the error

```auto
cannot find -lCint
collect2: error: ld returned 1 exit status
Makefile:15: recipe for target 'Many3DHistogramsForum_Compile_BROKEN.exe' failed

```

If I don’t include the “-lCint” part, I get the same error as before.

Again, sorry if I’m asking too much. Let me know if I should make another post about this issue.

Thanks again,  
Julian.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 1, 2020, 7:08am UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/28 "2020-05-01T07:08:56Z")

</div>

Try:

```bash
`root-config --cxx --cflags` -o myprogram myprogram.cxx `root-config --evelibs`

```

---

<div class="post-metadata">

**Author:** ![juliangb](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/juliangb/32/21448_2.png) [@juliangb](https://root-forum.cern.ch/u/juliangb)\
**Post date:** [May 1, 2020, 8:29pm UTC](https://root-forum.cern.ch/t/straight-line-through-th3/39104/29 "2020-05-01T20:29:14Z")

</div>

This worked, thank you a lot!

[Previous page](https://root-forum.cern.ch/t/straight-line-through-th3/39104.md?page=1)
