2012-01-19 61 views
5

我想使用升壓過程事件,但它尚未發佈。我做升壓過程中缺少異常

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隱藏呢?

+0

根據我的經驗,最好使用更新版本的boost.process,比如soc2010:http://www.highscore.de/boost/gsoc2010/process.zip http://www.highscore.de/boost/gsoc2010/ – alfC

回答

2

我通過在我的g ++命令行上傳遞-DBOOST_FILESYSTEM_VERSION = 2來解決這個問題。

+2

Boost Filesystem v2已棄用,並計劃在即將發佈的Boost版本中消失。 –

12

你需要編輯過程/ operations.hpp刪除此:

#include <boost/filesystem/path.hpp> 

,而是這樣說:

#include <boost/filesystem/operations.hpp> 

我認爲這將使它與提高文件系統兼容V3(其將很快成爲唯一的版本,計劃升壓1.48)。

+1

如果在Boost 1.52中使用Boost.Process,這確實有幫助。 –