Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

migrating from IVF to G77

trnsys
Beginner
592 Views
I wrote an IVF exe that uses a few Windows API calls (LoadLibrary, getProcAddress) and uses a pointer structure to call a DLL (also written in IVF). For reasons outside my control, I have to migrate the exe to the G77 compiler. My attempt to compile the fortran code in G77 stumbles at the lines:

use dfwin
use dflib

does anyone have any experience with implementing calls to LoadLibrary and getProcAddress in the G77 compiler? I hope this is not an inappropriate question to ask on the IVF forum - if so, my apologies!

best,
david
0 Kudos
1 Solution
TimP
Honored Contributor III
592 Views
As g77 hasn't been maintained for several years, you should consider gfortran. For one thing, g77 never acquired many f90 features such as USE. For questions on gfortran, you should subscribe to fortran@gcc.gnu.org mail list. There is no single Windows version of either g77 or gfortran; you must make a choice among mingw, cygwin et al. Many dfwin or dflib capabilities could be translated, but there isn't a full direct correspondence.

View solution in original post

0 Kudos
3 Replies
TimP
Honored Contributor III
593 Views
As g77 hasn't been maintained for several years, you should consider gfortran. For one thing, g77 never acquired many f90 features such as USE. For questions on gfortran, you should subscribe to fortran@gcc.gnu.org mail list. There is no single Windows version of either g77 or gfortran; you must make a choice among mingw, cygwin et al. Many dfwin or dflib capabilities could be translated, but there isn't a full direct correspondence.
0 Kudos
John4
Valued Contributor I
592 Views

As tim18 suggested, you should consider using gfortran instead of g77 ---that way, you can easily create create an interface to LoadLibrary and getProcAddress with the aid of the ISO_C_BINDING module and the bind(C,...) attribute.

gfortran also implements some compiler directives (e.g., STDCALL ) that might be useful if you're targeting win32.

0 Kudos
mecej4
Honored Contributor III
592 Views
If the only reason for your calling the Windows API is to use some computational or I/O routines in a DLL, there is a simpler alternative worth considering,

Build the DLL and a stub export library for the routines. Import the routines into your application using the stub library. As long as you follow the calling conventions needed, you can use any Fortran compiler (including G77).
0 Kudos
Reply