- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
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).
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page