How to compile a simple programme with ROOT?

Hello, everyone. I’m a beginner in using ROOT :smiley:
I just don’t know how to open a new window to compile a very simple C++ programme.
I looked up through the user’s guide, but cannot find useful information. After open ROOT, what should I type before write C++ sentences? I’m using ROOT in Windows operating system.
Could you please help me? Thank you very much!

Hello, I am not sure to have well understood what you said but I think the answer is

.L your_program.C++ your_program()

Thanks for your reply. I’m sorry that I didn’t make myself clear.
I tried your code in ROOT, but it said that macro not found in path…
In fact, I’m wondering how to open such a window or a similar window, like the one shown in the following picture, to edit and compile C++ sentences in ROOT.

Hmmm, the picture that you shown is a simple text editor. It is not a ROOT window. So you type your code in your favorite text editor (let us say that you will name it “your_program.C”) and then, you run ROOT typing “root” in your terminal. And then you can compile your code with the two lines I gave in my previous message.

:slight_smile: .I see,I’ll try it. Thank you very much.!