gpt4 book ai didi

c++ - Boost 过程中缺少异常

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:08:54 24 4
gpt4 key购买 nike

我想使用 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隐藏它?

最佳答案

您需要编辑 process/operations.hpp 来删除它:

#include <boost/filesystem/path.hpp> 

而是这样说:

#include <boost/filesystem/operations.hpp>

我认为这将使它与 Boost Filesystem v3 兼容(很快将成为唯一版本,计划用于 Boost 1.48)。

关于c++ - Boost 过程中缺少异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8926715/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com