- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I compile a project consisting of routines and functions in different f90 files, I can get warnings having the form
Error error LNK2019: unresolved external symbol _SOMEROUTINEORFUNCTION referenced in function _SOMEFUNCTIONORdlgproc.obj
If every subroutine or function must contain an interface block for each routine or function it might reference, is there a compile option or tool that forces the production of a PROJECT.FI file containing all the necessary prototype interface blocks obtained from the definitions of each function or subroutine that is being compiled? Then an interface module can be constructed that can be included in each Fortran file, taking care of the risk of unresolved externals.
I have looked under Project debug properties...Fortran...Output files and cannot see reference to production of interface blocks.
I note that a recent project folder of mine contained a PROJECT.FI file which contained a single prototype interface block for a function that is nowhere in the project!
TIA
Anthony Richards
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See: gen-interfaces (intel.com)
Interfaces should be specified in a module and not as an include file (.fi).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Providing interfaces, either in the form of interface blocks in the source code or in include files, or in a module that is then used in other sources where those interfaces are needed, helps the compiler to generate the correct calling sequence. However, the actual subroutines/functions that those interfaces pertain to may be contained in other sources or in libraries. The corresponding OBJ files and/or LIB files must be searched at link time, and you can facilitate that either by modifying the linker command line, or by using OBJCOMMENT directives in your source codes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mecej4 is correct. to simplify the message: the unresolved symbol warnings have nothing to do with interfaces. It's link time, not compile time warnings or errors. Your link phase either is missing libraries or you have other issues with your build (Project Properties)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You really really need to be using modules and sub-modules and all the interface issues will go away and your codes will be much more robust and "self checking".
![](/skins/images/872293744008A34B36F8ABF94A46CC66/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page