Re: Declarations cause "Error: Non-static-const variable in array dimension"

From: Stefan Piperov <piperov_at_fnal.gov>
Date: Thu, 8 Apr 2010 14:41:56 +0300

Ida, that's basic C++, not ROOT specific issue. Do you really want to bother this list with it?! S>

On Thu, 8 Apr 2010, Ida Häggström wrote:

> Hi!
> I'm writing a C-macro to run in ROOT, but I get an error when running it:
> ----------------------------------
> Error: Non-static-const variable in array dimension
> /home/ida/GATE/ROOT_v5.24/root/share/root/macros/Gate_To_Stir_Delayed_modified.C:42:
> (cint allows this only in interactive command and special form macro which
> is special extension. It is not allowed in source code. Please ignore
> subsequent errors.)
> ----------------------------------
> The relevant part of my code looks like:
> -----------------------------------
> int nRings = 18; // Number of rings in the GE Advance
> scanner
> int Num_sinos = nRings*nRings;
> int nPHI = 336; // Number of angular bins in the
> sinogram
> int nU = 283; // Number of radial bins in the sinogram
> float tmp0[Num_sinos*nPHI*nU], sinogram_STIR_out[Num_sinos][nPHI][nU];
> -----------------------------------
> The line which causes the error is the last line, "float tmp0...". I tried
> changing to "static int" on all int declarations, but the same error appears
> anyway. Does anyone know what is the problem? Thanks in advance!
> Ida
>

*---------------------------------------------------------------------*
  Stefan Piperov      Mail: FNAL P.O.Box 500, MS 205, Batavia, IL-60510
  Phone: (630) 840-5176                        E-Mail: piperov_at_fnal.gov
*---------------------------------------------------------------------*
"Give a skeptic an inch... and he'll measure it." Received on Thu Apr 08 2010 - 13:42:03 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 08 2010 - 17:50:02 CEST