Straight line through TH3

When I run root-config --config it returns the text in this archive: rootconfig.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.

root-config --features

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.

Do you try it like this:

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”?

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.

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

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:

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

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.

Try:

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

This worked, thank you a lot!