C++ C++;:在类中使用带有静态变量的map时遇到问题,我得到了未定义的符号

C++ C++;:在类中使用带有静态变量的map时遇到问题,我得到了未定义的符号,c++,map,function-pointers,C++,Map,Function Pointers,这就是我得到的错误 Undefined symbols: "Config::fmap", referenced from: register_function(unsigned int (*)(unsigned int))in Config.o print_config() in shared.o ld: symbol(s) not found collect2: ld returned 1 exit status 配置.h #include <map

这就是我得到的错误

Undefined symbols:
  "Config::fmap", referenced from:
      register_function(unsigned int (*)(unsigned int))in Config.o
      print_config()     in shared.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
配置.h

#include <map>
#include <boost/preprocessor/stringize.hpp>

typedef unsigned int (*fptr_t)(unsigned int);
typedef std::map<fptr_t, std::string> function_name_map_type;

void register_hash_names();
void register_function(fptr_t funct_pointer);

class Config
{
public:

    static function_name_map_type fmap;
};
Shared.cpp,其中错误源于:

std::cout << "\t " << Config::fmap[Config::current_hash_function] << "\n";

.cpp中的定义应为:

function_map_t Config::fmap;

.cpp中的定义应为:

function_map_t Config::fmap;