TH1D::Draw() fucntion doesn't show anything on windows

Hi,
I’m a beginner in ROOT. I use visual studio 2010 and I try to dynamically load the needed ROOT libs into my program.

When I use, for example TH1D::Draw() function ( on an instance ), it doesn’t show anything on the screen. if I save the data into a file and use it using cint with ROOT exe everything is working fine, I can see the window with the data.

Can you please advice why I can’t draw anything while using visual studio?

Thanks
Idan

Hi,

I’m afraid your question is not clear enough…

  • How did you create your application?
  • Did you properly create a TApplication and call TApplication::Run()?
  • Did you link your app with the Root gui libraries?
  • Did you take a look at the tutorials (in [color=#0000FF]$ROOTSYS/tutorials[/color]) and the applications in [color=#0000FF]$ROOTSYS/test[/color] ?
    Or maybe you could post a small piece of code showing what you’re trying to do…

Cheers, Bertrand.

Hi,

As a beginning step we recommend that rather than building/creating an application, you create a library that contains your code and load this library using the root.exe application (this guarantees that the application is properly linked and set up and avoid any order of initialization issues … thus simplifying the use).

Cheers,
Philippe.

Hi,

I’m really new here, so give me all the information you can. I have to write my program using visual studio, so I can’t just use root.exe. I think I’ve linked all the available libs. I didn’t create a new TApplication instance. what exactly do I have to do to be able to draw somethings using visual studio?
Where can I find the needed steps? I couldn’t find anything useful in the user documentation.
Thanks
Idan

[quote] I have to write my program using visual studio, so I can’t just use root.exe. I think I’ve linked all the available libs.[/quote]Why? Visual Studio is capable of producing libraries …

[quote]I didn’t create a new TApplication instance. what exactly do I have to do to be able to draw somethings using visual studio? [/quote]To have the graphics available, you must do so. Add TApplication *myapp = new TApplication("myapp",&argc,argvv);to you main.

Philippe.