Visual Studio 2012 C ++编译错误与Boost Signal2 [英] Visual Studio 2012 C++ compile error with Boost Signal2

查看:652
本文介绍了Visual Studio 2012 C ++编译错误与Boost Signal2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2012 Ultimate,并使用以下Boost Signals2代码:在 https:// github。 com / cfobel / boost_signals2 / blob / master / hello_world_0.cpp
生成以下错误:

I am using Visual Studio 2012 Ultimate with the following Boost Signals2 code: at https://github.com/cfobel/boost_signals2/blob/master/hello_world_0.cpp It generates the following error:

c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory(348): error C4996: 'std::_Uninitialized_copy0': 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'
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory(333) : see declaration of 'std::_Uninitialized_copy0'
1>          c:\libraries\boost_1_52_0\boost\signals2\detail\auto_buffer.hpp(192) : see reference to function template instantiation '_FwdIt std::uninitialized_copy<I,boost::variant<T0_,T1>*>(_InIt,_InIt,_FwdIt)' being compiled


$ b

此代码与Visual Studio不兼容2012 C ++?它仍然安全使用?最后,如何根据建议进行更改?
感谢

Is this code not compatible for Visual Studio 2012 C++? Is it still safe to use? Lastly, how do I make the changes as suggested? Thanks

推荐答案

C4996 是关于使用已标记为已弃用的函数的警告。您可能已将处理警告为错误(/ WX)选项启用了吗?

C4996 is a warning about using a function that has been marked deprecated. Since you're seeing it as an error, maybe you have the Treat Warning as Error (/WX) option enabled?

禁用此功能的方法在错误消息本身中进行了说明。将 _SCL_SECURE_NO_WARNINGS 符号添加到项目的预处理器定义。

The way to disable this one is described in the error message itself. Add the _SCL_SECURE_NO_WARNINGS symbol to the project's preprocessor definitions.

这篇关于Visual Studio 2012 C ++编译错误与Boost Signal2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆