Libtorrent:已声明不推荐使用的错误
Libtorrent : declared deprecated error
以下行:
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
因此,您应该使用libtorrent提供的函数将宽字符argv[1]转换为UTF-8,然后从中构建torrent_info。
此消息通常只是一个警告,也许您有一个将警告视为错误的标志。尝试删除/WX
编译器标志、Treat Warnings as Errors
选项,或通过添加此标志或选项禁用此特定警告:/wd 4996
。有关MSVC警告标志的详细信息。。。
相关文章:
- 错误:未在此范围内声明'reverse'
- C++错误C2600:无法定义编译器生成的特殊成员函数(必须首先在类中声明)
- 从具有默认值的部分指定模板类继承时发生SWIG错误,具有不带默认值的正向声明
- 错误:"imread"未在此范围内声明
- 在气泡排序程序中未声明错误功能
- 使用全局声明的向量时,C++双重释放错误/损坏
- 使用直接大括号初始化时,C++ 编译错误"声明末尾的预期";"
- C++ [错误] 声明'char '隐藏参数。什么意思?
- 类中的静态函数给出了错误:声明中的两种或多个数据类型
- 错误:声明冲突 - 指针不能是 int
- 收到 CUDA 错误"声明与以前的"variable_name"不兼容
- 错误:声明不声明
- Visual Studio 2010 链接器错误C++声明我从头文件创建的类时
- Cython 错误:声明不声明任何内容
- 错误"声明非模板函数"C++
- 无效地使用不完整的类型/前向错误声明.可能误用抽象类?(c++)
- 错误:声明冲突.用c++编译c代码
- C++错误:声明中存在显式限定
- else语句(C++)上的错误w/声明
- 初始化const类成员,错误:声明没有声明任何内容