那位大哥帮忙看一下,就这么一个类:
#if !defined(AFX_DUCK1_H__26B2A994_36A3_4A7E_9C31_843BF4C95478__INCLUDED_)
#define AFX_DUCK1_H__26B2A994_36A3_4A7E_9C31_843BF4C95478__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <map>
#include "IBehavior.h"class IDuck
{
map<char*,IBehavior*> MapBehavior;
public:
virtual void Action();
virtual void addBehavior(char*,IBehavior*);
virtual void removeBehavior(char*);
IDuck();
virtual ~IDuck();};#endif // !defined(AFX_DUCK1_H__26B2A994_36A3_4A7E_9C31_843BF4C95478__INCLUDED_)总出现这样的错误,
d:\myproject_qhp\2008-07-28-test\080729\复件 duck\duck1.h(16) : error C2143: syntax error : missing ';' before '<'
d:\myproject_qhp\2008-07-28-test\080729\复件 duck\duck1.h(16) : error C2501: 'map' : missing storage-class or type specifiers
d:\myproject_qhp\2008-07-28-test\080729\复件 duck\duck1.h(16) : error C2059: syntax error : '<'
d:\myproject_qhp\2008-07-28-test\080729\复件 duck\duck1.h(16) : error C2238: unexpected token(s) preceding ';'
Generating Code...
小弟实在搞不定,没办法了,求那位大哥帮忙看一下
#if !defined(AFX_DUCK1_H__26B2A994_36A3_4A7E_9C31_843BF4C95478__INCLUDED_)
#define AFX_DUCK1_H__26B2A994_36A3_4A7E_9C31_843BF4C95478__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <map>
#include "IBehavior.h"class IDuck
{
map<char*,IBehavior*> MapBehavior;
public:
virtual void Action();
virtual void addBehavior(char*,IBehavior*);
virtual void removeBehavior(char*);
IDuck();
virtual ~IDuck();};#endif // !defined(AFX_DUCK1_H__26B2A994_36A3_4A7E_9C31_843BF4C95478__INCLUDED_)总出现这样的错误,
d:\myproject_qhp\2008-07-28-test\080729\复件 duck\duck1.h(16) : error C2143: syntax error : missing ';' before '<'
d:\myproject_qhp\2008-07-28-test\080729\复件 duck\duck1.h(16) : error C2501: 'map' : missing storage-class or type specifiers
d:\myproject_qhp\2008-07-28-test\080729\复件 duck\duck1.h(16) : error C2059: syntax error : '<'
d:\myproject_qhp\2008-07-28-test\080729\复件 duck\duck1.h(16) : error C2238: unexpected token(s) preceding ';'
Generating Code...
小弟实在搞不定,没办法了,求那位大哥帮忙看一下
解决方案 »
- 能不能提供一些msmxl的sax2的实例代码啊?
- SendMessage的延时问题
- 如何在vc6中进行远程调试?
- 3000分求费尔防火墙源码及文档(2.0)
- First-chance exception in exe (KERNEL32.DLL): 0xE0000001: (no name).
- 如何在COMBO BOX中把下拉框变的长一些?如何使COMBO BOX有默认显示值?
- 急救!给个信息也好!-------在线等待
- 远程教学网站中的MPEG4压缩格式AVI播放器(嵌入网页中)
- csdn有个大的bug!
- 求助,在win32或者mfc下实现录音功能
- 线程的问题
- VC++MFC中OPENGL和GDI能否同时显示,欢迎给出思路
using namespace std;否则编译器不认识map,只认识std::map
或
std::map <char*,IBehavior*> MapBehavior; 还有,最好不要使用char*做为key,换成string更好些
using namespace std;