- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am brand new to Fortran. I have VB project that will have to call a Fortran DLL. For test purposes, to eliminate the VB to Fortran interface, I thought that I could write short main Fortran program to call the Fortran DLL and test the Fortran in the IDE debugger. This what I've tried.
Intel Fortran 7.0 in Visual C++ 6.0 IDE
I have 2 projects in a workspace.
The first consists of several files containing functions and subroutines compiled as a DLL. This compiles fine with no errors. The declaration of the subroutine main entry into the DLL has
SUBROUTINE MYDLL(S1, S2, S3)
!DEC$ ATTRIBUTES DLLEXPORT :: MYDLL
!DEC$ ATTRIBUTES ALIAS:'MYDLL'::MYDLL
calls to functions and other subroutines
rest of the code
END
The 2nd project is a Fortran main program that calls MYDLL. The main program contains the following
PROGRAM MAIN
!DEC$ ATTRIBUTES DLLIMPORT :: MYDLL
!DEC$ ATTRIBUTES ALIAS:'MYDLL'::MYDLL
CHAR (LEN=20) VAR1, VAR2, VAR3
some code
CALL MYDLL(VAR1, VAR2, VAR3)
more code
END
to import MYDLL.
When I try to compile, I get the following error on the CALL MYDLL line:
..main.for(8) Error 127 : This is not the name of a subroutine
Intel Fortran 7.0 in Visual C++ 6.0 IDE
I have 2 projects in a workspace.
The first consists of several files containing functions and subroutines compiled as a DLL. This compiles fine with no errors. The declaration of the subroutine main entry into the DLL has
SUBROUTINE MYDLL(S1, S2, S3)
!DEC$ ATTRIBUTES DLLEXPORT :: MYDLL
!DEC$ ATTRIBUTES ALIAS:'MYDLL'::MYDLL
calls to functions and other subroutines
rest of the code
END
The 2nd project is a Fortran main program that calls MYDLL. The main program contains the following
PROGRAM MAIN
!DEC$ ATTRIBUTES DLLIMPORT :: MYDLL
!DEC$ ATTRIBUTES ALIAS:'MYDLL'::MYDLL
CHAR (LEN=20) VAR1, VAR2, VAR3
some code
CALL MYDLL(VAR1, VAR2, VAR3)
more code
END
to import MYDLL.
When I try to compile, I get the following error on the CALL MYDLL line:
..main.for(8) Error 127 : This is not the name of a subroutine
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try adding EXTERNAL MYDLL in the main program before the ATTRIBUTES directives.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That helped. I am not moving on to debugging stage (problems) and will submit new post with that experience.
Thanks
Thanks
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