使用Boost String Algorithms Library时遇到的问题?包含boost/algorithm/string.hpp出错?
代码如下:
#include <boost/algorithm/string.hpp>
using namespace std;
using namespace boost;
// ...
int main( ){
string str1(" hello world! ");
to_upper(str1); // str1 == " HELLO WORLD! "
trim(str1); // str1 == "HELLO WORLD!"
string str2=to_lower_copy( ireplace_first_copy(str1,"hello","goodbye")); // str2 == "goodbye world!"
return 0;
}
编译时出现如下错误:
e:\lsh\c资料\boost_1_32_0\boost\algorithm\string\yes_no_type.hpp(22) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal
e:\lsh\c资料\boost_1_32_0\boost\algorithm\string\yes_no_type.hpp(23) : see reference to class template instantiation 'boost::algorithm::size_descriptor<I>' being compiled
e:\lsh\c资料\boost_1_32_0\boost\mpl\bool.hpp(37) : fatal error C1506: unrecoverable block scoping error
请问是什么原因?我用的是vc6.0
问题点数:100、回复次数:6Top
1 楼zyp2kyear(E腾鸟)回复于 2004-12-02 14:00:53 得分 10
贴出
yes_no_type.hpp文件内容Top
2 楼Jinhao(辣子鸡丁·GAME就这样OVER了)回复于 2004-12-02 14:05:48 得分 50
换个编译器,vc6对模板支持不行Top
3 楼vc8(沧海-巫山)回复于 2004-12-02 17:12:13 得分 0
那是不是说不能再vc6中使用Boost String Algorithms Library了Top
4 楼sharkhuang(走吧走吧!人总会慢慢长大~)回复于 2004-12-02 20:12:26 得分 20
不是Top
5 楼vc8(沧海-巫山)回复于 2004-12-03 10:41:50 得分 0
那该怎么解决这个问题呢Top
6 楼snlee(新丁)回复于 2004-12-03 13:35:43 得分 20
vc6编译不通过,vs2003编译通过Top




