提问者:小点点

与boost相关得源中得定位错误[重复]


我正在把一个旧项目从Boost1.48移植到Boost1.61。 该项目使用MSVC 2013进行编译。 在构建过程中有几个报告的错误,我认为这些错误与boost相关,但不幸的是,这些错误报告根本没有太大的帮助。

3>  entry.cpp
4>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2715): error C2220: warning treated as error - no 'object' file generated
4>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2715): warning C4996: 'std::_Fill_n': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
4>          c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2701) : see declaration of 'std::_Fill_n'
4>          c:\boost\boost_1_61_0\boost\random\detail\polynomial.hpp(114) : see reference to function template instantiation '_OutIt std::fill_n<boost::random::detail::polynomial_ops::digit_t*,size_t,boost::random::detail::polynomial_ops::digit_t>(_OutIt,_Diff,const _Ty &)' being compiled
4>          with
4>          [
4>              _OutIt=boost::random::detail::polynomial_ops::digit_t *
4>  ,            _Diff=size_t
4>  ,            _Ty=boost::random::detail::polynomial_ops::digit_t
4>          ]

我在上面看不到任何帮助我识别问题所在的东西,没有行号,代码片段不是来自编译的文件。


共1个答案

匿名用户

@eljay,它有一个我可以在IDE中找到的人类可读文本选项吗? -43分钟前SPlatten

你贴的是人类可读的文字。 它实际上描述了一个引用文档的警告。 '\()/'也许你可以告诉编译器你不想收到警告

此外,您还可以使用关键字谷歌其他信息:

C++Boost:这个警告的原因是什么?

此外,许多库已经具有警告抑制头(查找例如boost/iostreams/detail/config/disable_warnings.hppboost/random/detail/disable_warnings.hpp)。 已知的良性警告“漏掉”这一事实可能表明库需要更新它们的抑制,或者您可能需要升级您的boost版本。