- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having problems using a derived data type as an object in a named common block. I placed the derived type and the common statement in an include file and tried to use the include file in three subroutine. The linker gives error 2005, followed by 1169 stating that the named block was already defined. Is there a way to do this? Thank you.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd bet a quarter that you have specified initial values for one or more COMMON variables in the INCLUDE file. The Fortran language does not allow a COMMON block to be initialized in multiple program units, and the Microsoft linker doesn't like it either!
Solution - take the initialization out of the INCLUDE. Add a BLOCK DATA subprogram which INCLUDEs the definition of the COMMON and then has the initialization in DATA statements.
Steve
Solution - take the initialization out of the INCLUDE. Add a BLOCK DATA subprogram which INCLUDEs the definition of the COMMON and then has the initialization in DATA statements.
Steve
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