warning with const array in header

X

Xavier Serrand

Defining a const array in header, i can not get ride of a warning :

const char * ROW_INFO_NAMES[NB_ROW_INFOS] = {"Nbr Val",
"Nbr Ok", "Nbr Ko",
"Moy",
"Var", "Ety",
"Moy OK", "Moy KO",
"Var OK", "Var KO",
"Distance",
"Selected"};

indicateurs.obj: multiple definition of _ROW_INFO_NAMES
first definition is in file preparedata.obj

other solution :

static const char * ROW_INFO_NAMES[NB_ROW_INFOS] = {"Nbr Val",
"Nbr Ok", "Nbr Ko",
"Moy",
"Var", "Ety",
"Moy OK", "Moy KO",
"Var OK", "Var KO",
"Distance",
"Selected"};

Warning .\colanalyse.h: 52 static `array 12 of pointer to const char
ROW_INFO_NAMES' is not referenced
0 errors, 1 warnings

Any help welcome !!

Xavier
 
I

Ian Collins

Xavier said:
Defining a const array in header, i can not get ride of a warning :

const char * ROW_INFO_NAMES[NB_ROW_INFOS] = {"Nbr Val",
"Nbr Ok", "Nbr Ko",
"Moy",
"Var", "Ety",
"Moy OK", "Moy KO",
"Var OK", "Var KO",
"Distance",
"Selected"};

indicateurs.obj: multiple definition of _ROW_INFO_NAMES
first definition is in file preparedata.obj


Warning .\colanalyse.h: 52 static `array 12 of pointer to const char
ROW_INFO_NAMES' is not referenced
0 errors, 1 warnings

Any help welcome !!
declare in the header:

extern const char * ROW_INFO_NAMES[NB_ROW_INFOS];

And define in one and only one compilation unit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top