c++ - C++ map : expected initializer before ‘<’ token

标签 c++ map compiler-errors

我在头文件中收到此错误:

error: expected initializer before ‘<’ token


class MyEntity;
typedef std::map<uint16,MyEntity*> myList_t;

我认为它没有看到 map 包含,但该头文件的顶部是:
#include <list>
#include <map>

在另一个头文件中:
typedef unsigned int               uint32;

有任何想法吗?

g++(GCC)4.1.2 20080704(Red Hat 4.1.2-48)

最佳答案

有一个名为map的宏正在引起冲突。

关于c++ - C++ map : expected initializer before ‘<’ token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6558697/

相关文章:

c++ - 围绕整数 getter 和 setter 的关键部分是否多余?

c++ - 这些有什么区别?

java - Spring boot问题主类给出编译错误

c++ - 我可以使用 Biicode 在 Travis 上安装 GCC 4.9 和 Clang 3.5 吗?

c++ - 使用 C++、Qt 进行亮度、对比度、 Gamma 调整

c++访问映射中数组的元素

list - Data.map 中 haskell 列表的复杂性

c++ - 如何使用在包含使用符号的文件的文件中声明的符号(函数、字段、类等)。 C++

java - 在类里面找不到符号

c++ - GCC 和 Clang 不会对未使用的异常变量发出警告