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

From: Ida Häggström <ida.haggstrom_at_radfys.umu.se>
Date: Thu, 8 Apr 2010 09:37:57 +0200


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 Received on Thu Apr 08 2010 - 09:38:02 CEST

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