Re: #include in root macro

From: Diego Faso <faso_at_to.infn.it>
Date: Tue, 15 Feb 2005 12:16:50 +0100 (MET)


Thanks a lot, I have modified my rootlogon.C as you suggested and now it works.
Cheers
Diego

On Tue, 15 Feb 2005, Fons Rademakers wrote:

> Hi Diego,
>
> to make it work do:
>
> root [] .include <path>/test/include
>
> Or you can add to your rootlogon.C macro:
>
> char *inc = gSystem->ExpandPathName("$HOME/test/include")
> gInterpreter->AddIncludePath(inc)
> delete [] inc
>
> ACLiC will also look at this CINT include path so there is no need anymore
> to add it with ACLiC.IncludePaths.
>
> If you use the cvs head then the ExpandPathName() is not needed anymore
> since I've added it to AddIncludePath().
>
>
> Cheers, Fons.
>
>
>
> Diego Faso wrote:
> > Good morning, I have a problem concerning the inclusion of header-files in
> > my root macro when I don't use ACLiC: I added the path to my header file
> > ($HOME/test/include/ClassTest.h)in this way:
> >
> > gEnv->SetValue("ACLiC.IncludePaths","-I$HOME/test/include");
> >
> > and the test macro is "TestMacro.C":
> > //----------------------------------------------
> > #include "ClassTest.h"
> > #include <Riostream.h>
> > #include "TCanvas.h"
> > void TestMacro{
> > cout << "Test" << endl;
> > TCanvas *ct = new TCanvas();
> > TClassTest *mytest = new TClassTest();
> > }
> > //----------------------------------------------
> >
> > I can compile my macro with ACLiC, but if I run the same macro without
> > compiling it (without the "++"), this error message appears:
> >
> > Error: cannot open file "ClassTest.h" FILE:TestMacro.C LINE:1
> > *** Interpreter error recovered ***
> >
> > The inclusion of root headers does not cause any problem, so I think I
> > should add the path to my include files somewhere, but I don't know
> > where. Is there a way to fix this problem?
> >
> > The description of my system is:
> > - OS: Linux Fedora-Core 3
> > - gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
> > - root version: 4.03/01
> >
> > Thank you in advance.
> > Cheers
> > Diego Faso
>
> --
> Org: CERN, European Laboratory for Particle Physics.
> Mail: 1211 Geneve 23, Switzerland
> E-Mail: Fons.Rademakers_at_cern.ch Phone: +41 22 7679248
> WWW: http://www.rademakers.org/fons/ Fax: +41 22 7679480
>
Received on Tue Feb 15 2005 - 12:16:58 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET