boost::create_directory 在发布模式下返回异常

boost::create_directory returns exception in release mode

本文关键字:模式 返回 异常 布模式 create directory boost      更新时间:2023-10-16

>我有以下代码来创建目录。

string path = "\\hilbert\MRoot\2017-05-04"
boost::filesystem::create_directory(path );

当我在调试模式下运行它时,此代码有效,但它在发布模式下给了我一个异常。 发布模式下的异常是"字符串迭代器不兼容">

我正在使用视觉工作室为我的发布和调试模式提供的默认设置。

编辑:我在发布模式下链接到boost_filesystem-vc110-mt-gd-1_60.lib。我将其更改为 boost_filesystem-vc110-mt-1_60.lib,它开始工作。

你使用来自库提升的对象path例如

using namespace boost::filesystem;
path p{"D:\newDirectory"};
create_directory( p );