-3

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?

4

2 回答 2

1

你看过里面的评论了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。

于 2015-06-27T18:55:11.403 回答
0

这个消息通常只是一个警告,也许你有一个标志来将警告视为错误。尝试通过添加此标志或选项来删除/WX编译器标志、Treat Warnings as Errors选项或禁用此特定警告:/wd 4996有关 MSVC 警告标志的更多信息...

于 2015-06-27T18:54:52.813 回答