的Visual Studio 2012 c + +编译升压第二信号错误 [英] Visual Studio 2012 C++ compile error with Boost Signal2

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

问题描述

我使用Visual Studio 2012旗舰版具有以下升压Signals2 code:在的 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

这是code为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 是一个警告有关使用已标记为德precated功能。因为你看到它是错的,也许你有治疗的警告当作错误(/ 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 符号添加到项目中的preprocessor定义。

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 + +编译升压第二信号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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