Extern error: a storage class can only be specified for objects and functions [closed]

  c++, extern

main.cc:

unordered_map<string, unordered_map<string, string> TABLET;

globals.h:

extern unordered_map<string, unordered_map<string, string> TABLET;

Error:

globals.h:7:1: error: a storage class can only be specified for objects and functions
    7 | extern unordered_map<string, unordered_map<string, string> TABLET;
      | ^~~~~~

I’m getting the above error when I extern an unordered_map. Not sure why I’m getting this error.

Source: Windows Questions C++

LEAVE A COMMENT