libtorrent-rasterbar编译示例

时间:2012-03-25 23:06:23

标签: c++ boost

我想用libtorrent-rasterbar用torren开发一些测试,但是当我试图编译包中的例子时我得到了这个错误:

   g++ dump_torrent.cpp 
In file included from /usr/local/include/libtorrent/torrent_info.hpp:61:0,
                 from dump_torrent.cpp:40:
/usr/local/include/libtorrent/file_storage.hpp:110:8: error: ‘void libtorrent::file_storage::add_file(const wpath&, libtorrent::size_type, int, time_t, const boost::filesystem3::path&)’ cannot be overloaded
/usr/local/include/libtorrent/file_storage.hpp:106:8: error: with ‘void libtorrent::file_storage::add_file(const boost::filesystem3::path&, libtorrent::size_type, int, time_t, const boost::filesystem3::path&)’
In file included from dump_torrent.cpp:40:0:
/usr/local/include/libtorrent/torrent_info.hpp:195:3: error: ‘libtorrent::torrent_info::torrent_info(const wpath&)’ cannot be overloaded
/usr/local/include/libtorrent/torrent_info.hpp:193:3: error: with ‘libtorrent::torrent_info::torrent_info(const boost::filesystem3::path&)’
/usr/local/include/libtorrent/torrent_info.hpp:204:3: error: ‘libtorrent::torrent_info::torrent_info(const wpath&, boost::system::error_code&)’ cannot be overloaded
/usr/local/include/libtorrent/torrent_info.hpp:202:3: error: with ‘libtorrent::torrent_info::torrent_info(const boost::filesystem3::path&, boost::system::error_code&)’
In file included from /usr/local/include/libtorrent/magnet_uri.hpp:38:0,
                 from dump_torrent.cpp:42:
/usr/local/include/libtorrent/torrent_handle.hpp:585:8: error: ‘void libtorrent::torrent_handle::move_storage(const wpath&) const’ cannot be overloaded
/usr/local/include/libtorrent/torrent_handle.hpp:581:8: error: with ‘void libtorrent::torrent_handle::move_storage(const boost::filesystem3::path&) const’
/usr/local/include/libtorrent/torrent_handle.hpp:586:8: error: ‘void libtorrent::torrent_handle::rename_file(int, const wpath&) const’ cannot be overloaded
/usr/local/include/libtorrent/torrent_handle.hpp:582:8: error: with ‘void libtorrent::torrent_handle::rename_file(int, const boost::filesystem3::path&) const’

库的版本是:libtorrent-rasterbar-0.15.10 libboost-1.46 另外我试图在linux下使用它。

如果您需要其他信息,我很乐意将其提供给您。 感谢

2 个答案:

答案 0 :(得分:2)

我找到了解决方案。

Libtorrent-rasterbar需要boost-filesystem版本号2,但当前版本是3,所以为了解决这个问题,你必须用这个标志编译它: 的 -DBOOST_FILESYSTEM_VERSION = 2

答案 1 :(得分:0)

尝试使用构建脚本。 我还使用libtorrent-rasterbar进行了实验,我可以通过下一个命令生成dump_torrent:

make dump_torrent