boost/unordered_集:使用mingw()编译错误

boost/unordered_集:使用mingw()编译错误,boost,mingw,unordered-set,Boost,Mingw,Unordered Set,我有一段使用boost无序集的代码 #include <boost/unordered_set.hpp> boost::unordered_set<string> mySet(100); 对我来说,这似乎是一个与模板相关的问题;有什么建议吗 谢谢,, 马蒂亚 [编辑] 还可以使用其他boost功能,例如词法转换 #include <boost/lexical_cast.hpp> #包括 似乎有些typedef破坏了boost cstdint头,如下所示

我有一段使用boost无序集的代码

#include <boost/unordered_set.hpp>
boost::unordered_set<string> mySet(100);
对我来说,这似乎是一个与模板相关的问题;有什么建议吗

谢谢,, 马蒂亚


[编辑]

还可以使用其他boost功能,例如词法转换

#include <boost/lexical_cast.hpp>
#包括

似乎有些typedef破坏了boost cstdint头,如下所示

103   using ::int8_t;
104   using ::int_least8_t;
105   using ::int_fast8_t;
106   using ::uint8_t;
107   using ::uint_least8_t;
108   using ::uint_fast8_t;
在我的系统上。因此,一些英雄可能定义了“#define uint8_t”而不是“typedef…uint8_t”,这段代码因此中断


您可以尝试修改boost/config/platform/win32.hpp,如果有帮助,请向mingw开发人员报告错误。

mingw和gcc的哪个版本?也许你可以用C++0x无序_集来代替boost中的这个?什么版本的boost?您是否有
#包括
?和
使用std::string
使用名称空间标准?@Zuljin抱歉,mingw32-boost-1.41.0和mingw32-gcc-c++-4.4.2。包括字符串头,我使用的是std::string。你说得对。我发现在我的项目中有一个“英雄”做了同样的事情:
\define uint8\u t unsigned char
103   using ::int8_t;
104   using ::int_least8_t;
105   using ::int_fast8_t;
106   using ::uint8_t;
107   using ::uint_least8_t;
108   using ::uint_fast8_t;