Boost C++ Libraries: Ticket #2427: message_queue uses deprecated function in VS 8.0 https://svn.boost.org/trac10/ticket/2427 <p> There is a usage of a deprecated function in Visual Studio 8.0 (2005) when using the message_queue in the interprocess library. However, this ONLY manifests itself when there is a #include &lt;string&gt; BEFORE the #include &lt;boost/interprocess/ipc/message_queue.hpp&gt;. If the string include is after the message_queue include, everything compiles fine. </p> <p> For example: </p> <pre class="wiki">#include &lt;string&gt; #include &lt;boost/interprocess/ipc/message_queue.hpp&gt; #include &lt;iostream&gt; int main(int argc, char* argv[]) { boost::interprocess::message_queue* rcv; std::string exampleString = "Hi"; std::cout &lt;&lt; exampleString &lt;&lt; &amp;rcv &lt;&lt; std::endl; return 0; } </pre><p> returns the warning </p> <pre class="wiki">1&gt;BoostMessageQueueTest.cpp 1&gt;c:\program files\microsoft visual studio 8\vc\include\xutility(2404) : warning C4996: 'std::_Copy_backward_opt' was declared deprecated 1&gt; c:\program files\microsoft visual studio 8\vc\include\xutility(2391) : see declaration of 'std::_Copy_backward_opt' 1&gt; Message: 'You have used a std:: construct that is not safe. See documentation on how to use the Safe Standard C++ Library' 1&gt; e:\boost building\boost_1_36_0\boost\interprocess\ipc\message_queue.hpp(270) : see reference to function template instantiation '_BidIt2 std::copy_backward&lt;boost::interprocess::detail::mq_hdr_t:: msg_hdr_ptr_t*,boost::interprocess::detail::mq_hdr_t::msg_hdr_ptr_t*&gt;(_BidIt1,_BidIt1,_BidIt2)' being compiled 1&gt; with 1&gt; [ 1&gt; _BidIt2=boost::interprocess::detail::mq_hdr_t::msg_hdr_ptr_t *, 1&gt; _BidIt1=boost::interprocess::detail::mq_hdr_t::msg_hdr_ptr_t * 1&gt; ] </pre><p> however if I do: </p> <pre class="wiki">#include &lt;boost/interprocess/ipc/message_queue.hpp&gt; #include &lt;string&gt; #include &lt;iostream&gt; int main(int argc, char* argv[]) { boost::interprocess::message_queue* rcv; std::string exampleString = "Hi"; std::cout &lt;&lt; exampleString &lt;&lt; &amp;rcv &lt;&lt; std::endl; return 0; } </pre><p> then everything builds without any warnings. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2427 Trac 1.4.3 Ion Gaztañaga Tue, 18 Nov 2008 08:01:57 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2427#comment:1 https://svn.boost.org/trac10/ticket/2427#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> This is not a bug. Microsoft deprecates by default many STL algorithms. This is disabled by internal interprocess headers in detail/config_begin.hpp. Some interprocess headers include &lt;string&gt; so trying to reinclude it after has no effect. </p> <p> Sadly, it's programmers job to define _CRT_SECURE_NO_DEPRECATE in the project to avoid this annoying warning. </p> Ticket