boost vc6 使用filesystem时,文件err_code.hpp编译通不过(使用模板) 敬请各位高手能不吝赐教!

czxstarhust 2008-04-15 10:58:42
问题如题目。补充一下:最近在使用boost,使用了filesystem类库。
引用头文件:#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"

源代码://先测试使用filesystem有没有问题,程序主体未完成
namespace fs = boost::filesystem;
// get the path
if (strPath.size() < 2)
{
return;
}

fs::path full_path(fs::initial_path());
full_path = fs::system_complete(fs::current_path(strPath,fs::native));

unsigned long file_count = 0;
unsigned long dir_count = 0;
unsigned long err_count = 0;

if (!fs::exists( full_path ))
{
//TODO
}
但在编译时,在err_code.hpp文件中出现了大量错误:
c:\boost\include\boost-1_35\boost\system\error_code.hpp(45) : error C2252: 'value' : pure specifier can only be specified for functions
c:\boost\include\boost-1_35\boost\system\error_code.hpp(45) : see reference to class template instantiation 'boost::system::is_error_code_enum<T>' being compiled
c:\boost\include\boost-1_35\boost\system\error_code.hpp(48) : error C2252: 'value' : pure specifier can only be specified for functions
c:\boost\include\boost-1_35\boost\system\error_code.hpp(48) : see reference to class template instantiation 'boost::system::is_error_condition_enum<T>' being compiled
c:\boost\include\boost-1_35\boost\system\error_code.hpp(144) : error C2258: illegal pure syntax, must be '= 0'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(144) : error C2252: 'value' : pure specifier can only be specified for functions
c:\boost\include\boost-1_35\boost\system\error_code.hpp(227) : error C2039: 'type' : is not a member of 'enable_if<struct boost::system::is_error_condition_enum<Cond>,void>'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(241) : error C2039: 'type' : is not a member of 'enable_if<struct boost::system::is_error_condition_enum<Cond>,class boost::system::error_condition>'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(294) : error C2784: 'struct boost::type &__thiscall boost::system::error_condition::operator =(ConditionEnum)' : could not deduce template argument for 'struct boost::type &' from 'class boost:
:system::error_condition &'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(294) : error C2785: 'struct boost::type &__thiscall boost::system::error_condition::operator =(ConditionEnum)' and 'class boost::system::error_condition &__thiscall boost::system::error_conditi
on::operator =(const class boost::system::error_condition &)' have different return types
c:\boost\include\boost-1_35\boost\system\error_code.hpp(242) : see declaration of '='
c:\boost\include\boost-1_35\boost\system\error_code.hpp(314) : error C2039: 'type' : is not a member of 'enable_if<struct boost::system::is_error_code_enum<Cond>,void>'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(327) : error C2039: 'type' : is not a member of 'enable_if<struct boost::system::is_error_code_enum<Cond>,class boost::system::error_code>'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(381) : error C2784: 'struct boost::type &__thiscall boost::system::error_code::operator =(CodeEnum)' : could not deduce template argument for 'struct boost::type &' from 'class boost::system::e
rror_code &'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(381) : error C2785: 'struct boost::type &__thiscall boost::system::error_code::operator =(CodeEnum)' and 'class boost::system::error_code &__thiscall boost::system::error_code::operator =(const
class boost::system::error_code &)' have different return types
c:\boost\include\boost-1_35\boost\system\error_code.hpp(328) : see declaration of '='
c:\boost\include\boost-1_35\boost\system\error_code.hpp(389) : error C2143: syntax error : missing ';' before '}'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(395) : error C2143: syntax error : missing ';' before '}'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(445) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
我使用的是vc6,敬请各位高手能不吝赐教,解决这个问题。
...全文
325 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
看看是什么代码引起的,通常你得升级编译器。
taodm 2008-04-15
  • 打赏
  • 举报
回复
VC6,建议升级编译器,或者不考虑使用boost。
czxstarhust 2008-04-15
  • 打赏
  • 举报
回复
err_code.hpp 是boost自带的system库的文件,我估计是vc编译器的问题,但不确定。
Treazy 2008-04-15
  • 打赏
  • 举报
回复
错误这么多,一个一个改吧
czxstarhust 2008-04-15
  • 打赏
  • 举报
回复
谢谢大家 是编译器的问题 刚刚换了vs2005 通过了

24,855

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧