首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

新手!vs2008中的关于boost:filesystem的奇怪报错

2012-06-03 
新手求助!!vs2008中的关于boost::filesystem的奇怪报错我在vs中的部分代码为:#include boost/filesystem.

新手求助!!vs2008中的关于boost::filesystem的奇怪报错
我在vs中的部分代码为:
#include "boost/filesystem.hpp"
namespace bfs = boost::filesystem;


if (bfs::exists(savePath[path_it->first]))
{
bfs::remove(savePath[path_it->first]);
}
bfs::copy_file(tempPath[path_it->first],savePath[path_it->first]);
bfs::resize_file(savePath[path_it->first],len);
其中copy_file处报错说“Unhandled exception at 0x7502d36f in client.exe: Microsoft C++ exception: boost::filesystem3::filesystem_error at memory location 0x0027f05c..”

还有,我的
bfs::path tempDir = saveDir/"temp";
bfs::remove_all(tempDir); //报同样的错Unhandled exception at 0x7502d36f in client.exe: Microsoft C++ exception: boost::filesystem3::filesystem_error at memory location 0x0024eb04..

不知道什么原因,现在一头雾水,急求牛人指教!!谢谢了。。。




[解决办法]
这不很明显么。。。未捕获的异常

C/C++ code
try{  if (bfs::exists(savePath[path_it->first])){    bfs::remove(savePath[path_it->first]);  }  bfs::copy_file(tempPath[path_it->first],savePath[path_it->first]);  bfs::resize_file(savePath[path_it->first],len);}catch(const std::exception& e){//异常处理} 

热点排行