storage class specified for 'FileCase' error

jis picture jis · Nov 13, 2011 · Viewed 9.6k times · Source

I tried to compile some code however am getting the error

  storage class specified for 'FileCase'

What does this error mean?

Does it have to do with the fact I have declared it as an extern int in the private part of the header file ?

I am unable to resolve the issue. In the cpp file, I have declared it as

  int FileCase =0; 

inside of the function where it is needed however it does not resolve the problem. Does anyone know what the issue could be?

Thanks

Jis

Answer

neagoegab picture neagoegab · Nov 13, 2011

in the .h file you should have:

extern int FileCase; but not in a class...

and in the cpp file you should have a global variable:

int FileCase = initializer;