Chinaunix首页 | 论坛 | 博客
  • 博客访问: 438016
  • 博文数量: 126
  • 博客积分: 35
  • 博客等级: 民兵
  • 技术积分: 1262
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-19 16:39
文章分类

全部博文(126)

文章存档

2017年(2)

2016年(20)

2015年(64)

2014年(24)

2013年(16)

我的朋友

分类: C/C++

2014-03-24 15:42:25

编译时报错,如下:
  1. > compiling src/CMapServerInfo.o ...
    g++ -c -g -Wall -O2 -I include -I ../ -I ../../Lib/Threading/include/ -I ../../Lib/Algorithmic/include/ -I ../../Lib/im/include/ -I ../../Lib/ProcConnPool/include/ -I ../../Lib/StringUtil/include/ -I /oracle/product/11.2.0/db_1/precomp/public/ -D"_LOG2BOTH" -D"VERSION=1.0" -D_DEBUG   src/CMapServerInfo.cpp -o src/CMapServerInfo.o
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_pair.h: In instantiation of ‘std::pair, std::allocator >, cu_server_info>’:
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tree.h:135:   instantiated from ‘std::_Rb_tree_node, std::allocator >, cu_server_info> >’
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tree.h:1264:   instantiated from ‘void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_erase(std::_Rb_tree_node<_Val>*) [with _Key = std::basic_string, std::allocator >, _Val = std::pair, std::allocator >, cu_server_info>, _KeyOfValue = std::_Select1st, std::allocator >, cu_server_info> >, _Compare = std::less, std::allocator > >, _Alloc = std::allocator, std::allocator >, cu_server_info> >]’
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tree.h:578:   instantiated from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::~_Rb_tree() [with _Key = std::basic_string, std::allocator >, _Val = std::pair, std::allocator >, cu_server_info>, _KeyOfValue = std::_Select1st, std::allocator >, cu_server_info> >, _Compare = std::less, std::allocator > >, _Alloc = std::allocator, std::allocator >, cu_server_info> >]’
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_map.h:93:   instantiated from here
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_pair.h:73: 错误:‘std::pair<_T1, _T2>::first’ has incomplete type
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/strin**d.h:56: 错误:declaration of ‘const struct std::basic_string, std::allocator >’
    make: *** [src/CMapServerInfo.o] 错误 1

加上#include 就好了。
阅读(1604) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~