Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!princeton!pucc!BVAUGHAN From: BVAUGHAN@pucc.Princeton.EDU (Barbara Vaughan) Newsgroups: comp.lang.fortran Subject: Re: Externals and Block Data Message-ID: <12010@pucc.Princeton.EDU> Date: 6 Nov 90 22:47:38 GMT References: <28325@shamash.cdc.com> Reply-To: BVAUGHAN@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 35 Disclaimer: Author bears full responsibility for contents of this article In article <28325@shamash.cdc.com>, ddh@hare.cdc.com (Dan Horsfall) writes: >Problem: How to load a BLOCK DATA subprogram from a LIBRARY. > (This can be a problem since you can't CALL a block data subprogram > in the usual sense, thus the loader/linker process ofmatching > external references to entry points frequently does not work.) > I believe the original question here involved an unresolved external in a program compiled using an old version of MS Fortran. I didn't realize that a BLOCK DATA subroutine was involved or I would have responded sooner. I learned that there was some kind of bug in MS-Fortran handling of BLOCK DATA subroutines. (MS tech support called it an 'instability'.) I haven't used MS Fortran in a long time, but here is a note from my files. (5) Note to programmers: This diskette contains an execution module which should run on most DOS systems. It should not be necessary to recompile the program. If for some reason the program must be recompiled, the following precaution should be heeded. MM contains a BLOCK DATA subroutine which, because of a peculiarity in version 3.2 of MS-FORTRAN, must be stored in a separate file, compiled separately, and must precede the main program in the LINK phase. Both the source and object code files for this subroutine are included (MMBLOCK.FOR and MMBLOCK.OBJ). Earlier or later releases of MS-FORTRAN may not require this precaution, in which case MMBLOCK may be added to the source file MMPC.FOR. Check with MICROSOFT technical support for details. Failure to compile and link as described here causes peculiar errors during execution which appear to be unrelated to the BLOCK DATA subroutine. When I say 'must precede the main program in the link phase', I mean that when you list the names of the object code files, you put the file containing the BLOCK DATA subroutine first in the list. I hope this helps. Barbara Vaughan