Hi all,
first of anything else I feel compelled to sincerely thank all those who have made ROOT possible. I began using it today from VisualStudio 2010.
I wrote the following console application in Visual Studio 2010:
// Esercizi Libro.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <Windows4Root.h>
#include "TApplication.h"
#include "TH1D.h"
#include "THistPainter.h"
#include "TCanvas.h"
#include "TBenchmark.h"
#include "TSlider.h"
#include "TRandom.h"
#include "TMinuit.h"
#include "TFormula.h"
#include "TF1.h"
#include "TObjectTable.h"
using namespace std;
int main()
{
//Display interpreted functions
//Author: Rene Brun
//
// To see the graphics output of this macro, click begin_html <a href="gif/formula1.gif">here</a>. end_html
//
TCanvas *c1 = new TCanvas("c1","Example with Formula",200,10,700,500);
//
// We create a formula object and compute the value of this formula
// for two different values of the x variable.
//
auto form1 = new TFormula("form1","sqrt(abs(x))");
form1->Eval(2);
form1->Eval(-45);
//
// Create a one dimensional function and draw it
//
auto fun1 = new TF1("fun1","abs(sin(x)/x)",0,10);
c1->SetGridx();
c1->SetGridy();
fun1->Draw();
c1->Update();
//
// Before leaving this demo, we print the list of objects known to ROOT
//
if (gObjectTable) gObjectTable->Print();
system("pause");
return 0;
}
I apologize for all the headers listed but I did a lot of attempts and they added up.
This compiles perfectly, runs perfectly ( it is taken from one of your examples, by the way ), the ROOT window opens and prints the list of all objects … but no chart !
Did I blunder anywhere ? For sure !
Would anyone be so kind to put me on the right path ?
Thank you in advance !