boost的shared_ptr在linux下gcc 4.4.5编不过去?
boost的shared_ptr在linux下gcc 4.4.5编不过去?
报奇怪的错误,说C++库头文件参数不一致??
boost版本1.46 关键就是报头文件有问题根本没到代码上
//////////////////////////////////////////////////错误1/////////////////////////////////////////////////////
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:353:41: 错误:宏“max”传递了 3 个参数,但只需要 2 个
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:364:41: 错误:宏“min”传递了 3 个参数,但只需要 2 个
In file included from /usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/stl_algo.h:61,
from /usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/algorithm:62,
from /mnt/hgfs/tmp/workspace/LwdpGit/Lwdp/code/h/LwApiLib/ComLib/boost/smart_ptr/shared_ptr.hpp:41,
from /mnt/hgfs/tmp/workspace/LwdpGit/Lwdp/code/h/LwApiLib/ComLib/boost/shared_ptr.hpp:17
//////////////////////////////////////////////////错误2/////////////////////////////////////////////////////
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:349: 错误:expected unqualified-id before ‘const’
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:349: 错误:expected ‘)’ before ‘const’
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:349: 错误:expected ‘)’ before ‘const’
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:349: 错误:expected initializer before ‘const’
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:353: 错误:‘const _Tp& std::max’声明为模板
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:360: 错误:expected unqualified-id before ‘const’
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:360: 错误:expected ‘)’ before ‘const’
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:360: 错误:expected ‘)’ before ‘const’
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:360: 错误:expected initializer before ‘const’
/usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/algorithmfwd.h:364: 错误:‘const _Tp& std::min’声明为模板
In file included from /usr/lib/gcc/i686-redhat-linux/4.4.5/../../../../include/c++/4.4.5/algorithm:62,
from /mnt/hgfs/tmp/workspace/LwdpGit/Lwdp/code/h/LwApiLib/ComLib/boost/smart_ptr/shared_ptr.hpp:41,
from /mnt/hgfs/tmp/workspace/LwdpGit/Lwdp/code/h/LwApiLib/ComLib/boost/shared_ptr.hpp:17,
[解决办法]
是你程序调用 shared_ptr 后编译过不去,还是直接编译 boost 就过不去?前者的话,把调用代码贴上来。
[解决办法]
赶紧接分!