EssentialC++PractiseFor4.3 error LNK2001: 无法解析的外部符号 "private: static class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,enum GlobalWrap::uLevel,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,enum GlobalWrap::uLevel> > > GlobalWrap::_user_level_map" (?_user_level_map@GlobalWrap@@0V?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4uLevel@GlobalWrap@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4uLevel@GlobalWrap@@@std@@@2@@std@@A)EssentialC++PractiseFor4.3 fatal error LNK1120: 1 个无法解析的外部命令
解决方案 »
- vc 2008 ActiveX 添加自定义消息
- CButtonST是否适合checkbox?
- CMap的问题,在线,等人救命。
- 编程买台式还是笔记本?(困扰人类半个世纪的问题)
- @@@@@@@@@@不上不下的问题:聚焦后的控件如何在VIEW中得到完整的“身材展现”@@@@@@@@@@?
- opengl蓝宝书第五版运行范例程序Triangle.exe出现 处未处理的异常: 0xC0000005:
- 在安装win9x,linux有没有指定的次序?是先安装win9x还是先安装linux?并注意些什么问题?
- 送分啊!
- 单文档窗口问题
- odbc数据库排序问题
- 如何编程在指定时间唤配休眠中的计算机?
- VC 如何调用surfer软件的插值函数?
{
...
static map<string, enum uLevel> _user_level_map; //这个叫静态变量的声明
}; map<string, enum uLevel> GlobalWrap::_user_level_map;//这个叫静态变量的定义
……
using namespace std;class GlobalWrap
{
public:
……
private:
//以下部分是为了解决4.4中的问题。
enum uLevel { Beginner, Intermediate, Advanced, Guru };
static map< string, enum uLevel > _user_level_map;};
map <string, enum uLevel> GlobalWrap::_user_level_map;
编译提示:error C2371: “_user_level_map” : 重定义;不同的基类型
很纳闷,为什么map <string, enum uLevel> GlobalWrap::写到这个地方的时候,提示出map的成员函数(map是泛型算法中的),而不是GlobalWrap的成员函数
Mackz 帮忙看看呢,谢谢了。
#include <osgViewer/Viewer>void main()
{
osgViewer::Viewer ok;
ok.setSceneData(osgDB::readNodeFile("cow.osg"));
ok.realize();
ok.run();
}
在h声明后,在cpp在定义下,map< string, enum uLevel > class::_userlevel_map;