TRandom problem with compiler

ROOT Version: 6.08.0
Platform: Ubuntu
Compiler: gcc version 7.2.0
I just recently installed ubuntu on my laptop and then root with cmake and I am not experienced with either. I want to make a program in C, written at the gedit text editor and I have included TRandom.h library but when I compile TRandom can’t be found:

fatal error: TRandom.h: No such file or directory
 #include <TRandom.h>
compilation terminated

However I can find the TRandom.h file in the folder root_v6.08.00.source/math/mathcore/inc.
Do I have to move the folder? What is the problem?

The problem is with:

It’s a lot simpler to do

root [0] #include "mycode.C"


root [0] .L mycode.C+

(to have it compiled) - that way you don’t need to figure out how to compile and link. Else you need a build system; have a look here:


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