The following line :
p.ti = new torrent_info(argv[1], ec);
shows the below error :
error C4996: 'libtorrent::torrent_info::torrent_info': was declared deprecated
How may I resolve this?
The following line :
p.ti = new torrent_info(argv[1], ec);
shows the below error :
error C4996: 'libtorrent::torrent_info::torrent_info': was declared deprecated
How may I resolve this?
你看过里面的评论了torrent_info.hpp
吗?
// all wstring APIs are deprecated since 0.16.11
// instead, use the wchar -> utf8 conversion functions
// and pass in utf8 strings
因此,您应该使用 libtorrent 提供的函数将您的宽字符 argv[1] 转换为 UTF-8,然后从中构造您的 torrent_info。
这个消息通常只是一个警告,也许你有一个标志来将警告视为错误。尝试通过添加此标志或选项来删除/WX
编译器标志、Treat Warnings as Errors
选项或禁用此特定警告:/wd 4996
。有关 MSVC 警告标志的更多信息...