- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using Intel(R) Visual Fortran Composer XE 2011 Integration for Microsoft Visual Studio* 2010, In my fortran code, the encountered problem is that I can not use "function" in my module, currently I just change the "function" to "subroutine" to simply abviate this problem.
When I use function in my code, I always meet with the error " error LNK2019 ".
Can anyone tell me how to resolve this problem? Thank you very much!
For the attached file, I can't compile successfully.
lyricx
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your description of the problem is rather vague, but here is what I guess to be the problem.
You declare a function in one module, and invoke that function in a different subprogram which does not have a USE ... statement for the first module.
Functions declared in a module receive name decorations, which explains the linker error that is issued when the invocation uses the undecorated name of the function. Rather than taking the trouble to learn and use the decoration scheme, you will do better if you employ an appropriate USE statement.
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