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
無法閱讀文檔。看起來好像你沒有看到它,說實話。 –