RE: [ROOT] Const char[][]

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Oct 31 2003 - 22:16:30 MET


Hi Guido,

I am guessing that this declaration is inside a namespace (1) or in a .C
file (2).

All other cases I could think of were either working or illegal C++.

In case (1), use

#ifdef __CINT__
const char DBDataTypesNames[8][20];
#else
  const char DBDataTypeNames[8][20] = {"bool", "vector<bool>", "int",
"vector<int>", "float", "vector<float>", "string", "empty"};
#endif

In case (2), either DBDataTypesNames is already defined in a header either
it
is not suppose to bepublic so just do:

#ifndef __CINT__
  const char DBDataTypeNames[8][20] = {"bool", "vector<bool>", "int",
"vector<int>", "float", "vector<float>", "string", "empty"};
#endif

Cheers,
Philippe

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Guido Gagliardi
Sent: Friday, October 31, 2003 12:00 PM
To: 'roottalk@pcroot.cern.ch'
Subject: [ROOT] Const char[][]


Hi,
still trying to generate the dictionary for my class, i got this error
message:

Generating dictionary RootDBDict.cxx...
Error: array initialization FILE:PixConfDBInterface.h LINE:33
Syntax Error: "empty" Maybe missing ';' FILE:PixConfDBInterface.h LINE:33
Error: Too many '}' FILE:PixConfDBInterface.h LINE:118
Warning: Error occured during reading source files
Warning: Error occured during dictionary source generation
!!!Removing RootDBDict.cxx RootDBDict.h !!!
Error: rootcint: error loading headers...
make: *** [RootDBDict.cxx] Error 1

referring to this code line:

  const char DBDataTypeNames[8][20] = {"bool", "vector<bool>", "int",
"vector<int>", "float", "vector<float>", "string", "empty"};

Is this normal? What sould i do to avoid this problem?

I am using root 3.10.01 and linux red hat 7.3, with gcc 2.96

Thank you

Guido



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET