Missing Exception in Boost Process
Asked Answered
F

2

6

I want to use Boost Process eventhough it has not been release yet. I did

svn co svn://svn.boost.org/svn/boost/sandbox/process/ boost-process

added boost-process to include path (-I) and #included <boost/process.hpp> but compilation complains about filesystem_error not being defined:

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’

I tried changing namespace to boost::filesystem3 but with same results.

The defintion of filesystem_error is

  class BOOST_SYMBOL_VISIBLE filesystem_error : public system::system_error

Is BOOST_SYMBOL_VISIBLE hiding it?

Ferrin answered 19/1, 2012 at 13:21 Comment(1)
In my experience it is better to use a newer version of boost.process, like soc2010: highscore.de/boost/gsoc2010/process.zip highscore.de/boost/gsoc2010Pamplona
E
13

You need to edit the process/operations.hpp to remove this:

#include <boost/filesystem/path.hpp> 

And instead say this:

#include <boost/filesystem/operations.hpp>

I think this will make it compatible with Boost Filesystem v3 (which will soon be the only version, scheduled for Boost 1.48).

Ephor answered 21/3, 2012 at 0:10 Comment(1)
This helps indeed if using Boost.Process with Boost 1.52.Pfeifer
A
1

I fixed this by passing -DBOOST_FILESYSTEM_VERSION=2 on my g++ command line.

Alys answered 21/3, 2012 at 0:1 Comment(1)
Boost Filesystem v2 is deprecated and scheduled to disappear in the upcoming release of Boost.Ephor

© 2022 - 2024 — McMap. All rights reserved.