2

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

jis
  • 75
  • 1
  • 2
  • 10
  • I think you should declare FileCase in the .h file, not the .cpp file, then assign it value in the .cpp. I'm not sure if this is the exact error. Anyway, I need more code. – Crazy Bear Nov 13 '11 at 02:30
  • what means private part of the header file? how can a header part be private? it is declared in a class as extern int? – joy Nov 13 '11 at 03:11

1 Answers1

6

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;

joy
  • 1,569
  • 8
  • 11