Re: [ROOT] C++ Header File/CINT failure to communicate

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Dec 05 2001 - 08:36:37 MET


Hi Sean,

Two problems in foo.h
 - you have a missing blank in the line declaring propFunc
 - you have an illegal initialisation of foo

do:

extern int foo(float *in, float *out, int init);

static struct {
  int NoOfInput;    /* Number of Input Units  */
  int NoOfOutput;   /* Number of Output Units */
  int (*propFunc)(float *, float*, int);
} fooREC; 


Rene Brun

On Tue, 4 Dec 2001, Sean Walston wrote:

> Here is a header file foo.h to a function foo.c. The claim is that I can
> just say
> 
> #include "foo.h"
> 
> in my own code that calls foo. Here is foo.h:
> 
> 				***
> 
> extern int foo(float *in, float *out, int init);
> 
> static struct {
>   int NoOfInput;    /* Number of Input Units  */
>   int NoOfOutput;   /* Number of Output Units */
>   int(* propFunc)(float *, float*, int);
> } fooREC = {3,1,foo};
> 
> 				***
> 
> When I ' #include "foo.h" ' and run it, Root CINT objects:
> 
> 	Error: unrecognized language construct foo.h LINE:6
> 	*** Interpreter error recovered ***
> 
> In other words, CINT seems to object to this line:
> 
> 	  int(* propFunc)(float *, float*, int);
> 
> Any suggestions on how to sort this out so CINT won't get it's knickers in
> a twist? It would be nice to make as few changes as possible.
> 
> 	Thanks -- Sean
> 
> __________________________________________________________________________
> 
>                                Sean Walston
> --------------------------------------------------------------------------
> Willamette Hall, Office 414A     SLD
> Department of Physics            Stanford Linear Accelerator Center, MS-94
> University of Oregon             P.O. Box 4349
> Eugene, OR 97403                 Stanford, CA 94309
> walston@ampere.uoregon.edu       walston@SLAC.stanford.edu
> Office:       541-346-4722
> Home/Mobile:  541-912-5456
> __________________________________________________________________________
> 



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