RE: [ROOT] problems with LinkDef.h

From: Work (pcanal@fnal.gov)
Date: Tue Sep 04 2001 - 00:14:02 MEST


Hi,

In your files essai1.h you need to add the lines:

#include "TObject.h"
#include "TCanvas.h"

Cheers,
Philippe

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Primrose Mbanefo
Sent: Monday, September 03, 2001 9:21 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] problems with LinkDef.h


Hello everyone,
       I've taken a look on the net and I can't find where I went wrong. I'm
trying to change a file which contains all the functions I use on my buttons
to a shared library. I've declared these functions in a personal header file
and then I created a linkdef.h header file.

For now I have something like this:
//*************************in
essai1.cxx*************************************
#ifndef _CINT_
#include "TCanvas.h"
#include "essai1.h"
#endif

void clearscreen()
{
  gROOT->GetListOfCanvases()->Delete();
}

//***********************in
essai1.h*****************************************
void clearscreen();
Int_t numrun;
TCanvas *fcanvhodo1;

//********************in essai1LinkDef.h**********************************
#ifdef _CINT_

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ function clearscreen;
#pragma link C++ global numrun;
#pragma link C++ global fcanvhodo1;
#endif

but the instruction:
rootcint -f essai1Dict.cxx essai1.h essai1LinkDef.h gives:

Error: No symbol Int_tnumrun in current scope  FILE:essai1.h LINE:5

if i change Int_t to int and if I reuse the same instruction I get :

Error: No symbol TCanvas in current scope  FILE:essai1.h LINE:6
Error: No symbol fcanvhodo1 in current scope  FILE:essai1.h LINE:6

Can anyone help,
Thanks, Primrose



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:59 MET