 <p>When you build with the DLL version of the CRT (/MDd for example), errno is a macro. Translating it to a function call to obtain the shared value of errno. Fix it like this:</p> <pre><code>int err = errno; </code></pre> <p>so you can inspect the value of err.</p>