title: How to use delay loading with a DLL that exports C++ classes
body: <p>I have a DLL <code>one.dll</code> that uses a class <code>TwoClass</code> exported from <code>two.dll</code> via <code>class __declspec(dllexport)</code>.  I'd like <code>one.dll</code> to use <code>/delayload</code> for <code>two.dll</code>, but I get a link error:</p>
  
  <pre><code>LINK : fatal error LNK1194: cannot delay-load 'two.dll' due to import
  of data symbol '"__declspec(dllimport) const TwoClass::`vftable'"
  (__imp_??_7TwoClass@@6B@)'; link without /DELAYLOAD:two.dll
  </code></pre>
  
  <p>That's in a Release build; in a Debug build it works.  (I don't know what the difference is between Release and Debug in terms of vtable exports, nor can I find any compiler switches or pragmas to control it.)</p>
  
  <p>How can I use <code>/delayload</code> with a DLL that exports classes like this in a Release build?</p>