title: Overloaded functions in C++ DLL def file
body: <p>I'm writing a C/C++ DLL and want to export certain functions which I've done before using a .def file like this</p>
  
  <pre><code>LIBRARY "MyLib"
  EXPORTS
    Foo
    Bar
  </code></pre>
  
  <p>with the code defined as this, for example:</p>
  
  <pre><code>int Foo(int a);
  void Bar(int foo);
  </code></pre>
  
  <p>However, what if I want to declare an overloaded method of Foo() like:</p>
  
  <pre><code>int Foo(int a, int b);
  </code></pre>
  
  <p>As the def file only has the function name and not the full prototype I can't see how it would handle the overloaded functions.  Do you just use the one entry and then specify which overloaded version you want when passing in the properly prototyped function pointer to LoadLibrary() ?</p>
  
  <p>Edit:  To be clear, this is on Windows using Visual Studio 2005</p>
  
  <p>Edit: Marked the non-def (__declspec) method as the answer...I know this doesn't actually solve the problem using def files as I wanted, but it seems that there is likely no (official) solution using def files.  Will leave the question open, however, in case someone knows something we don't have overloaded functions and def files.</p>