6

Boost Processがまだリリースされていませんが、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隠してる?

4

2 に答える 2

13

これを削除するには、process/operations.hpp を編集する必要があります。

#include <boost/filesystem/path.hpp> 

代わりに次のように言います。

#include <boost/filesystem/operations.hpp>

これにより、Boost Filesystem v3 (Boost 1.48 で予定されている唯一のバージョンとなる予定) と互換性があると思います。

于 2012-03-21T00:10:04.227 に答える
2

g++ コマンドラインで -DBOOST_FILESYSTEM_VERSION=2 を渡すことでこれを修正しました。

于 2012-03-21T00:01:01.600 に答える