c – Boost过程中缺少异常

前端之家收集整理的这篇文章主要介绍了c – Boost过程中缺少异常前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想使用Boost Process,尽管还没有发布.我做到了
svn co svn://svn.boost.org/svn/boost/sandBox/process/ boost-process

添加了boost-process以包含路径(-I)和#included< boost / process.hpp>但编译抱怨没有定义filesystem_error:

boost-process/boost/process/operations.hpp: In function ‘std::string boost::process::find_executable_in_path(const string&,std::string)’:
boost-process/boost/process/operations.hpp:85:36: error: ‘filesystem_error’ is not a member of ‘boost::filesystem3’
In file included from boost-process/boost/process.hpp:42:0,from tests/../fio.hpp:22,from tests/t_histogram.cpp:18:
boost-process/boost/process/operations.hpp:130:32: error: ‘filesystem_error’ is not a member of ‘boost::filesystem3’

我尝试将名称空间更改为boost :: filesystem3,但结果相同.

filesystem_error的定义是

class BOOST_SYMBOL_VISIBLE filesystem_error : public system::system_error

BOOST_SYMBOL_VISIBLE隐藏了吗?

解决方法

您需要编辑进程/ operations.hpp以删除它:
#include <boost/filesystem/path.hpp>

而是这样说:

#include <boost/filesystem/operations.hpp>

我认为这将使它与Boost Filesystem v3(很快将成为Boost 1.48的唯一版本)兼容.

猜你在找的C&C++相关文章