Thursday, 19 September 2013

ROOT libraries in Eclipse

ROOT libraries in Eclipse

I am getting started with eclipse and I want to include ROOT libraries to
C++ project. I am completly newbie so I have no idea what I should do.
I found that question: add library to eclipse C++ project (ROOT) and
followed this advices, but it doesn't work. I don't understand what means
'add root-config --libsto linker miscellanoeus'.
I have a simple program:
============================================================================
// Name : StaticParam.cpp
//============================================================================
#include <iostream>
#include <TH1.h>
#include <TCanvas.h>
int main(void) {
TH1F* hist = new TH1F("hist","hist",100,100,200);
for(int i=0;i<1000;++i) {
hist->Fill(i)
}
TCanvas *c = new TCanvas();
hist->Draw();
return 0;
}
and makefile:
clean:
rm StaticParam.o stat.exe
hello.exe: StaticParam.o
g++ -g -o stat StaticParam.o
main.o:
g++ -c StaticParam.cpp
g++ -o stat StaticParam.o
Could you give me some advices how could I link the root libraries to
eclipse and change makefile to run this example?
Thanks a lot, Roma

No comments:

Post a Comment