Value.h는 Value.cpp별도의지도 선언과 초기화
#include "Value.h"
std::map<uint8_t, std::string> status = {
{ 0x00, "Status1" },
{ 0x11, "Status2" },
{ 0x10, "Status3" }
};
#ifndef VALUE_H
#define VALUE_H
#include <map>
#include <string>
std::map<uint8_t, std::string> status;
#endif
는하지만 재정을 얻고 유지; 다중 초기화 오류; 선언하고 초기화하는 방법은 무엇입니까? 지도가 세계화되기를 바랍니다. 지도에서 클래스를 래핑하지 않을 수 있습니까? 이 파일을 다른 파일에 대한 맵 및 값의 정보로 지정하기 만하면됩니다.
그냥 'extern'으로 표시하십시오 ... – gsamaras