相关疑难解决方法(0)

C4503警告?我如何解决/摆脱它们?

这是我第一次尝试C++ STL.我正在尝试使用map构建一个多维关联数组.例如:

typedef struct DA {
    string  read_mode;
    string  data_type;
    void    *pValue;
    void    *pVarMemLoc;
}DA;

int main()
{
    map<string, map<string, map<string, map<string, map<string, DA*>>>>> DATA;

    DATA["lvl1"]["stg1"]["flr1"]["dep1"]["rom1"] = new DA;
    DATA["lvl1"]["stg1"]["flr1"]["dep1"]["rom2"] = new DA;
    DATA["lvl1"]["stg1"]["flr1"]["dep1"]["rom3"] = new DA;

    IEC["lvl1"]["stg1"]["flr1"]["dep1"]["rom1"]->read_mode = "file";
    IEC["lvl1"]["stg1"]["flr1"]["dep1"]["rom2"]->read_mode = "poll";
    IEC["lvl1"]["stg1"]["flr1"]["dep1"]["rom3"]->read_mode = "report";

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

在VS2005中编译上面的代码时,我收到了170个C4503警告.所有警告都是关于"超出装饰名称长度,名称被截断".该程序似乎运行正常.

任何人都要花些时间向我解释是什么原因引起了这些警告以及如何解决这些问题?提前致谢 :)

Warning 1   warning C4503: 'std::map<_Kty,_Ty>::~map' : decorated name length exceeded, name was truncated  c:\program files\microsoft visual studio 8\vc\atlmfc\include\cstringt.h 2121
Warning 2   warning C4503: 'std::map<_Kty,_Ty>::map' : decorated name length …
Run Code Online (Sandbox Code Playgroud)

c++ string stl map name-decoration

8
推荐指数
3
解决办法
1万
查看次数

标签 统计

c++ ×1

map ×1

name-decoration ×1

stl ×1

string ×1