Boost C++ Libraries: Ticket #5994: MSVC compiler misbehaviour - .lib & .exp files build for .EXE project https://svn.boost.org/trac10/ticket/5994 <p> There is bug in VS 2010 (and older versions) which makes EXE projects to build .LIB and .EXP files when using DLL runtime and "new (std::nothrow)" - as in "boost\pool" default_user_allocator_new_delete. </p> <p> The patch below is a workaround for this problem. According to this page: <a class="ext-link" href="http://bit.ly/nCKoel"><span class="icon">​</span>http://bit.ly/nCKoel</a> there are no plans to fix this error on MSVC side. </p> <pre class="wiki"> // -- file: // boost\pool\pool.hpp // -- under // static char * malloc BOOST_PREVENT_MACRO_SUBSTITUTION(const size_type bytes) // -- replace // { return new (std::nothrow) char[bytes]; } // -- with: #if defined(_DLL) &amp;&amp; defined(_MSC_VER) { try { return new char[bytes]; } catch (...) { return NULL; } } #else { return new (std::nothrow) char[bytes]; } #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5994 Trac 1.4.3 Steven Watanabe Sun, 16 Oct 2011 22:59:19 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5994#comment:1 https://svn.boost.org/trac10/ticket/5994#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">wontfix</span> </li> </ul> <p> Is there some reason that you can't just ignore the extra files? I object to obfuscating the code like this. </p> Ticket piotr.ns2011@… Mon, 17 Oct 2011 14:50:15 GMT <link>https://svn.boost.org/trac10/ticket/5994#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5994#comment:2</guid> <description> <p> Yes, I can ignore these files, but it's an additional build step that could be avoided. And this is the only piece of code in the whole boost library which adds this step. Note that I've set this ticket's severity to "cosmetic", so I can live without this change. </p> </description> <category>Ticket</category> </item> </channel> </rss>