title: how does __declspec(dllimport) actually work?
body: <p>I am trying to understand how dynamic linking works and I understand most of it but now how does the compiler or the linker know which dll exactly I am importing from?</p>
  <p>For example I have <code>test_program.dll</code> that exports a function called <code>test();</code> and I used <code>__declspec(dllimport)</code> in my program to import that function there could be thousands of functions in my system that have the same name and are also exported how does the compiler differentiate between them?</p>