[英]C++ Compile Error in Visual Studio 2012: LPCWSTR and wstring
[英]Visual Studio 2012 C++ compile error with Boost Signal2
我正在使用帶有以下Boost Signals2代碼的Visual Studio 2012 Ultimate: https : //github.com/cfobel/boost_signals2/blob/master/hello_world_0.cpp它生成以下錯誤:
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
此代碼與Visual Studio 2012 C ++不兼容嗎? 它還可以安全使用嗎? 最后,如何按照建議進行更改? 謝謝
C4996是關於使用已標記為已棄用的函數的警告。 由於您將其視為錯誤,您可能啟用了Treat Warning as Error (/WX)
選項嗎?
錯誤消息本身描述了禁用此方法的方法。 將_SCL_SECURE_NO_WARNINGS
符號添加到項目的預處理器定義中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.