Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

C calling Fortran using stdcall and CVF

$
0
0

I am trying to build and debug some old libraries.  I have a C dll routine calling a Fortran routine from a static library.  The C dll is built using calling convention stdcall, and the Fortran routine is built using calling convention CVF.

The C routine calls the Fortran routine like this:

   dfoefr(&igdfno, fstring[0], iostat, &istats, llen[0]);
  
and the variables are typed as:
   long igdfno  
   char *filspc 
   long iostat
   long istats
   size_t llen[1]          (unsigned int - length of filspc)
  
The Fortran routine call list is:

 SUBROUTINE DFOEFR (IGDFNO, FILSPC, IOSTAT, ISTATS)  
 
and the variables are typed as:
 INTEGER IGDFNO
 CHARACTER*(*) FILSPC
 INTEGER IOSTAT
 INTEGER ISTATS

The first two executable lines of code in the Fortran routine are:
      IOSTAT = 0
      ISTATS = 0

I can build the entire solution and step into the Fortran routine up to the 2nd executable line.  If I try to step further the program does not crash, but it jumps back to the GUI.

Rebuilding the libraries using default calling conventions is not an option since there are over 600 routines involved C calling Fortran and vice-versa, and stdcall written directly into the C code.

Suggestions?

Regards, Mike


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>