p.ti = new torrent_info(argv[1], ec);
显示下面的错误:
error C4996: 'libtorrent::torrent_info::torrent_info': was declared deprecated
我如何可以解决此问题?
p.ti = new torrent_info(argv[1], ec);
显示下面的错误:
error C4996: 'libtorrent::torrent_info::torrent_info': was declared deprecated
我如何可以解决此问题?
您是否阅读了torrent_info.hpp
中的评论?
// all wstring APIs are deprecated since 0.16.11
// instead, use the wchar -> utf8 conversion functions
// and pass in utf8 strings
因此,应该转换您宽字符的argv [1]为UTF-8使用由libtorrent提供的功能,然后构造从您的torrent_info。
谢谢我做了一个'(wchar *)'铸造变量来解决错误。 :-) – sjsam
此消息通常只是一个警告,也许你有一个标志将警告视为错误。尝试删除/WX
编译器标志,Treat Warnings as Errors
选项,或者通过添加此标志或选项:/wd 4996
来禁用此特定警告。 More info on MSVC warning flags...
将所有警告视为错误被禁用,即我有'/ WX-' – sjsam
你使用什么程序? – Ediac
无法阅读文档。看起来好像你没有看到它,说实话。 –