title: what must I link to avoid linker error on _aligned_alloc (MSVC command-line)?
body: <p>I'm trying to build a simple DLL on Windows that wraps _aligned_alloc, _aligned_realloc, and _aligned_free, using the cl command-line tools.  My source file is a .c file, includes &lt;stdlib.h&gt; and &lt;malloc.h&gt;, and seems to compile OK with:</p>
  <pre><code>cl /LD CustomAllocators.c /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib
  </code></pre>
  <p>but then fails to link, showing:</p>
  <pre><code>CustomAllocators.obj : error LNK2019: unresolved external symbol _aligned_alloc referenced in function Allocate
  CustomAllocators.dll : fatal error LNK1120: 1 unresolved externals
  </code></pre>
  <p>All those /NODEFAULTLIB switches are the result of much googling, and seem like they ought to do it, unless these allocation functions just aren't in any of those standard libraries... but in that case, I have no idea where they might be.</p>
  <p>Can anyone tell me what library I need to include to resolve these symbols, or if there's something else I might be doing wrong?</p>