Compiling a root macro like a c++ program

From: John Zoidberg <zohn.joidberg_at_gmail.com>
Date: Tue, 10 Apr 2007 10:34:53 +0200


I would like to make programs using ROOT classes, but compiled with the gcc/g++ compilers instead of this weird ACLiC/CINT system. I tried to understand the Makefile of the "test" folder with all the example programs, but it looks completely obscure to me.

So I just tried reusing the command lines used when running this makefile, to compile a simple "hello world" program containing no ROOT code a all for the moment:

g++ -O -Wall -fPIC -pthread -I/misc/cbmsoft/Debian3.1/new/tools/root/include
-c test.cxx

g++ -O test.o /u/mtaverne/root_compilation/libEvent.so
-L/misc/cbmsoft/Debian3.1/new/tools/root/lib -lCore -lCint -lHist -lGraf
-lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -pthread -lm
-ldl -rdynamic -o test

Here's the test.cxx file:

#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>

int main(int argc, char **argv)
{
  cout<<"Hello World!"<<endl;
  return(0);
}
(It includes more headers than needed, but that shouldn't be a problem.)

What I don't understand is that it does get compiled, but when I execute it, it displays nothing (whereas it does when I compile it with a simple "g++ test.cxx"). Received on Tue Apr 10 2007 - 10:35:00 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 11 2007 - 17:50:01 CEST