title: Trying to link my C++ executable with Fortran library (Cygwin environment)
body: <p>All my fortran sources compiled fine with</p>
  
  <pre><code>gfortran -g -c fortran_source.f
  </code></pre>
  
  <p>and archived in a single library called "mylibrary.a"
  In there, there exists a function of interest called "myfunction"</p>
  
  <p>In my C++ file, I have:</p>
  
  <pre><code>extern "C" void myfunction_(/* all pointers */);
  int main(){
  cerr &lt;&lt; "Mark 1" &lt;&lt; endl;
  myfunction_(/* all pointers or address_of my variables */);
  cerr &lt;&lt; "Mark 2" &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I compile my c++ executable, linking the library with</p>
  
  <pre><code>g++ mainfile.cpp -L./ -lmylibrary -lgfortran 
  </code></pre>
  
  <p>No errors or warnings...</p>
  
  <p>However, when I run my program it hangs at the first point where myfunction is called (prints "Mark1" but not "Mark 2")...</p>
  
  <p>Note that this program builds and runs correctly on a Linux machine with ifort (linking -lifcore).</p>
  
  <p>Thank you very much!</p>