Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Problem importing Fortran routine from a dll

$
0
0

I have a Fortran console application which is trying to import a routine from a Fortran dll.  I'm getting the following error message when linking.

error LNK2019: unresolved external symbol __imp__USELOG referenced in function _MAIN__

The interface for the routine is:
INTERFACE
   SUBROUTINE USELOG(logname, progname, version)
      !DEC$ ATTRIBUTES, ALIAS:'USELOG' :: USELOG
      !DEC$ ATTRIBUTES DLLIMPORT :: USELOG
      CHARACTER(LEN=26) :: logname
      CHARACTER(LEN=26) :: progname
      CHARACTER(LEN= 5) :: version
      !DEC$ ATTRIBUTES REFERENCE :: logname, progname, version
   END SUBROUTINE USELOG
END INTERFACE

The routine USELOG uses the following code for exporting:
   !DEC$ ATTRIBUTES DLLEXPORT :: USELOG
   !DEC$ ATTRIBUTES ALIAS:'USELOG' :: USELOG
   !DEC$ ATTRIBUTES REFERENCE :: logname_, progname_, version_

When I view the dll using dependency walker the routine is shown as USELOG without any decoration.

Could someone please tell me how to import this correctly.

Regards, Mike

 


Viewing all articles
Browse latest Browse all 5691

Trending Articles



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