title: How to create dynamic DLL library in C++, to substitute legacy Fortran DLL
body: <p>I have to create a dynamic DLL library in C++, to substitute old DLL library written in Fortran, without changing the host application (so functions and parameters must stay the same).</p>
  
  <p>I have full specification of all Fortran functions in that library, but what tools (compiler) I need to use, and what is the way of coding DLL in this situation (stdcall, cdecl, dllexport etc. - that clues doesn't say much to me, I never created a DLL before).</p>
  
  <p>This is sample Fortran function declaration in legacy DLL:</p>
  
  <pre><code>SUBROUTINE SetBoundaries(MaxFlow, MinFlow)
  cDEC$ ATTRIBUTES DLLEXPORT :: SetBoundaries
  cDEC$ ATTRIBUTES ALIAS: "SetBoundaries" :: SetBoundaries
  
  REAL MaxFlow
  REAL MinFlow
  </code></pre>
  
  <p>I tried to compile VC2008 DLL but got error:</p>
  
  <blockquote>
    <p>Unhandled error in 'InitAllPublicVars' Run-time error 453: Can't find
    DLL entry point DLLVersion in SomeLib.DLL</p>
  </blockquote>
  
  <p>Source of this DLL (defining function named DLLVersion doesn't help):</p>
  
  <pre><code>void __stdcall SetBoundaries( float *min , float *max ) {
  }
  </code></pre>
  
  <p>Is DLLVersion some special DLL procedure or just lack in my documentation and I should create such function?</p>
  
  <p>I know no details about original Fortran DLL source/compilation process, but there are some extracted informations:</p>
  
  <p><img src="https://i.stack.imgur.com/IIjZf.png" alt="General">
  <img src="https://i.stack.imgur.com/985C4.png" alt="Some options">
  <img src="https://i.stack.imgur.com/PAPsH.png" alt="Imports"></p>