Domanda

Voglio compilare l'esempio (make_torrent) da Sito ufficiale di Libtorrent:

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

Ma ricevo questo errore:

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

Ho installato Libtorrent-Rasterbar

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

Allora come dovrei compilare questo codice sorgente?

È stato utile?

Soluzione

È necessario aggiungere Libtorrent-Rasterbar al linker. Prova il seguente comando:

g++ create_torrent_file.cpp -o run -ltorrent-rasterbar -lboost_filesystem-mt
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top