? how to modify code between cint and compile modes

New to root…after several months of working at the command line level and with the most basic macros I’ve been tasked with a tougher job.

I’m building the new code using the makeclass() and makeselector() routines and get the following errors.
From searching and reviewing the forum messages I believe that I may need to compile my code, but need some basic advice/hints to get me over the hump.

I’ve tried >root [] .L code.C+ … and I get many pages of errors.

[code]#ifndef qdc4c_h
#define qdc4c_h

// for class access routines
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
// for loop() and plotting
#include <TH2.h>
#include <TStyle.h>
#include <TCanvas.h>

class qdc4c : public TSelector { // : public TSelector added
public :
TTree *fChain; //!pointer to the analyzed TTree or TChain
Int_t fCurrent; //!current Tree number in a TChain

[/code]

errors:

Error: Function P010_TPad() is not defined in current scope /usr/local/root_dev/include/TCanvas.h:1: *** Interpreter error recovered *** Error: Function P030_TGWin32() is not defined in current scope /usr/local/root_dev/include/TCanvas.h:1: *** Interpreter error recovered *** Error: Function P010_TGX11() is not defined in current scope /usr/local/root_dev/include/TCanvas.h:1: *** Interpreter error recovered *** Error: Function P020_TGX11TTF() is not defined in current scope /usr/local/root_dev/include/TCanvas.h:1: *** Interpreter error recovered *** Error: Function P040_TGQt() is not defined in current scope /usr/local/root_dev/include/TCanvas.h:1: *** Interpreter error recovered *** Error: Function P020_TQtRootGuiFactory() is not defined in current scope /usr/local/root_dev/include/TCanvas.h:1: *** Interpreter error recovered *** Error: Function P010_TRootGuiFactory() is not defined in current scope /usr/local/root_dev/include/TCanvas.h:1: *** Interpreter error recovered *** Error: class,struct,union or type qdc4c not defined qdc4c.h:53: *** Interpreter error recovered ***

Thanks,
Dave

It looks like you are missing some plug-in manager files in $ROOTSYS/etc.
Did you install from source? binaries?
Could you post your code.C and code.h files?

Rene

The initial goal was to build what I thought would work to get a shell started.
Currently I’ve gone with straight, compiled code and this has eliminated the errors.

However, if I was to create a compiled version of graphpolar.C (in the tutorials/graphs dir), aside from #includes and a makefile…what necessary differences would occur in calling the root methods?

and a remaining question: “What are the in-between functionalities of root (and roofit) where user libraries are compiled yet with scripts still executed in cint mode?”

Thanks

To execute graphpolar with the compiler, use ACLIC, ie, add the following includes at the top of polargraph.C

#include "TMath.h" #include "TCanvas.h" #include "TF1.h" #include "TGraphPolar.h" and do

root > .x polargraph.C+
simply the fact to add the “+” will tell CINT to use the built-in compiler interface called ACLIC.
the file polargraph.C will be automatically compiled by the native compiler and executed. You do not need makefiles and this works on Linux, Mac and Windows.
For more details about ACLIC, see pages 93-p4 in the CINT chapter of the Users Guide at
ftp://root.cern.ch/root/doc/7CINT.pdf

Rene