令牌之前的预期模板名称'<'
expected template name before '<' token
我是C 的新手。试图将基于Windows的程序移植到Linux。我使用的平台是Ubuntu 13.03。编译器为G 。
这是有问题的代码。
class CMapIDNames : public map< IDKey, string, CIDKeyLess >
{
} mapOfIDNames;
错误是:
错误:"&lt;"令牌之前的预期模板名称
尝试包括<functiontal>
和namespace::std
,无济于事。
您需要包括<map>
,并参考为std::map
。您似乎还缺少<string>
标头。
#include <map>
#include <string>
class CMapIDNames : public std::map< IDKey, std::string, CIDKeyLess >
{
};
但请注意,标准库容器不是为公共继承而设计的。您当然不应该以多态使用它们。
相关文章:
- 如何在C++中使用X509证书模在令牌中查找私钥
- holeMenuProgram.cpp:38:1 错误:'}'令牌之前的预期主表达式
- C++:"("令牌"之前有预期的非限定 id 指向类中成员函数的指针
- Arduino 用于语句错误。令牌之前的预期')' ';'。如何解决这个问题?
- 错误:令牌 { '{' 之前应存在非限定 ID
- 允许哪些令牌作为 #include 的参数?
- "错误 C0000:语法错误,令牌"<EOF>"处出现意外$end,并且不确定
- 它在 { 令牌之前给了我预期的标识符
- (错误:令牌之前'<<'预期的主表达式)
- 为什么 ## aka 令牌粘贴运算符不适用于 C 和 C++ 中的注释?
- 错误:"->"令牌之前的预期初始值设定项
- LINUX 操作系统上的错误:令牌之前预期的构造函数、析构函数或类型转换'('?
- 丢失读入的每一行输入中的最后一个令牌
- 如何使用 libCurl 将访问令牌发送到服务器 API
- C++令牌定义成员
- 宏定义中的预处理器令牌两边有两个双引号
- 错误:C++中']'令牌之前的预期主表达式
- 错误:令牌之前的预期主表达式'&&'
- 令牌之前']'预期的主表达式?
- '&lt;'''&lt;'''&quot的模板类错误''令牌”