【问题标题】:How to compile a libtorrent(rasterbar) code ?如何编译 libtorrent(rasterbar) 代码?
【发布时间】:2011-07-20 09:44:20
【问题描述】:

我想从libtorrent official website编译示例(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

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

【问题讨论】:

  • 尝试将-llibtorrent-rasterbar 添加到g++ 命令的末尾。

标签: boost compilation g++ libtorrent


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2015-08-29
    • 1970-01-01
    • 2014-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多