`
hunxiejun
  • 浏览: 1137607 次
文章分类
社区版块
存档分类
最新评论

在Sun OS系统上使用STL map引起冲突的问题

 
阅读更多

在Sun OS上,使用STL map时,有时系统会产生struct map 和class map冲突的问题。系统回报如下所示的错误:

/program/netopt/ACE_wrappers/ace/config-sunos5.10.h:64:30: warning: no newline at end of file
test.cpp: In function `int main()':
test.cpp:20: error: use of `map' is ambiguous
/usr/include/net/if.h:99: error: first declared as `struct map' here
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/bit
s/stl_map.h:92: error: also declared as `template<class _Key, class _Tp, class
_Compare, class _Alloc> class std::map' here

此时需要在引用mapd的时候,加上命名空间前缀,即使用std::map。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics