编译时报错,如下:
-
> 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
就好了。
阅读(1612) | 评论(0) | 转发(0) |