1

我想从libtorrent 官方网站编译示例(make_torrent) :

g++ create_torrent_file.cpp -o run -lboost_filesystem-mt 

但我得到这个错误:

create_torrent_file.cpp:(.text+0x158): undefined reference to
`libtorrent::file_storage::file_storage()'

我安装了 libtorrent-rasterbar

ldconfig -v | grep libtorrent:
libtorrent-rasterbar.so.6 -> libtorrent-rasterbar.so.6.0.0

那么我应该如何编译这个源代码呢?

4

1 回答 1

2

您需要将 libtorrent-rasterbar 添加到链接器。尝试以下命令:

g++ create_torrent_file.cpp -o run -ltorrent-rasterbar -lboost_filesystem-mt
于 2011-03-22T11:27:03.573 回答