Comment compiler un code libtorrent (rasterbar)?
-
28-10-2019 - |
Question
Je veux compiler un exemple (make_torrent) du site officiel de libtorrent :
g++ create_torrent_file.cpp -o run -lboost_filesystem-mt
Mais j'obtiens cette erreur:
create_torrent_file.cpp:(.text+0x158): undefined reference to
`libtorrent::file_storage::file_storage()'
J'ai installé libtorrent-rasterbar
ldconfig -v | grep libtorrent:
libtorrent-rasterbar.so.6 -> libtorrent-rasterbar.so.6.0.0
Alors, comment dois-je compiler ce code source?
La solution
Vous devez ajouter libtorrent-rasterbar à l'éditeur de liens.Essayez la commande suivante:
g++ create_torrent_file.cpp -o run -ltorrent-rasterbar -lboost_filesystem-mt
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow