title: How do I (programmatically) ensure that a dll contains definitions for all exported functions?
body: <p>Let's say I have this lib</p>
  <pre><code>//// testlib.h
  #pragma once
  #include &lt;iostream&gt;
  
  void __declspec(dllexport) test();
  int __declspec(dllexport) a();
  </code></pre>
  <p>If I omit the definition for <code>a()</code> and <code>test()</code> from my testlib.cpp, the library still compiles, because the <strong>interface</strong> [1] is still valid. (If I use them from a client app then they won't link, obviously)</p>
  <p>Is there a way I can ensure that when the obj is created (which I gather is the compiler's job) it actually looks for the definitions of the functions that I explicitly exported, and fails if doesn't ?</p>
  <p>This is not related to any real world issue. Just curious.</p>
  <hr />
  <p>[1] <a href="https://docs.microsoft.com/en-us/cpp/cpp/dllexport-dllimport?view=vs-2019#remarks" rel="nofollow noreferrer">MSVC docs</a></p>