Boost C++ Libraries: Ticket #8926: Windows error messages used for errno codes https://svn.boost.org/trac10/ticket/8926 <p> Consider the following: </p> <pre class="wiki">using namespace boost::system; system_error e(errc::resource_unavailable_try_again, system_category()); std::cout &lt;&lt; e.what() &lt;&lt; std::endl; </pre><p> This should print something along the lines of "Resource unavailable", but instead it prints "An attempt was made to load a program with an incorrect format". </p> <p> The value of <code>errc::resource_unavailable_try_again</code> is 11, or <code>EAGAIN</code>. What is printed, however, is the message for the Windows system error code <code>ERROR_BAD_FORMAT</code>, which is also 11. </p> <p> I encountered this while using boost::thread. I got the above message when I ran out of memory during thread creation. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8926 Trac 1.4.3 Lars T. Kyllingstad <lars.kyllingstad@…> Thu, 25 Jul 2013 08:31:34 GMT <link>https://svn.boost.org/trac10/ticket/8926#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8926#comment:1</guid> <description> <p> I forgot to say, I am compiling with Visual Studio 2010 on Windows 7. </p> </description> <category>Ticket</category> </item> <item> <author>s.cheban@…</author> <pubDate>Tue, 17 Sep 2013 10:04:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8926#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8926#comment:2</guid> <description> <p> Try system_error e(errc::resource_unavailable_try_again, <strong>generic_category</strong>()); </p> </description> <category>Ticket</category> </item> </channel> </rss>