[comp.lang.fortran] Microsoft Fortran Question - linking

jlhaferman@l_eld09.icaen.uiowa.edu (Jeffrey Lawrence Haferman) (05/05/90)

Hi,

I just got a copy of Microsoft Fortran 2.2 and have lost
my patience trying to link some external subroutines.

The main program "J2.ftn" compiled fine, and it calls subroutines
"SUB1" and "SUB2" which are located in file "SUBS.ftn"
which also compiled fine once I turned on the "R" (subprogram
compile) option.

The fortran compiler produced a file "J2 APL" and "SUBS.sub".
I went into the linker and said "f J2" followed by "o SUBS"
then "g", and it complains of unresolved references to 
"SUB1" and "SUB2" even though they should be found.

So, how am I suppossed to be linking this stuff?  Also,
Microsoft has done a horrible job with this product in
my opinion - I'm using it since the it is the only
Macintosh Fortran the University has.  



Jeff Haferman                            internet: jlhaferman@icaen.uiowa.edu
Department of Mechanical Engineering
University of Iowa
Iowa City IA  52240

silvert@cs.dal.ca (Bill Silvert) (05/06/90)

In article <1432@ns-mx.uiowa.edu> jlhaferman@l_eld09.icaen.uiowa.edu (Jeffrey Lawrence Haferman) writes:
>I just got a copy of Microsoft Fortran 2.2 and have lost
>my patience trying to link some external subroutines.
>
>The main program "J2.ftn" compiled fine, and it calls subroutines
>"SUB1" and "SUB2" which are located in file "SUBS.ftn"
>which also compiled fine once I turned on the "R" (subprogram
>compile) option.
>
>The fortran compiler produced a file "J2 APL" and "SUBS.sub".
>I went into the linker and said "f J2" followed by "o SUBS"

Error ................ this should be               "f SUBS".

You have told the linker to link only J2.apl and to create the
executable application called J2.  The documentation states quite
clearly that the files to be linked are read in with the "f" command
(the main application comes first).  The "o" command is like the "-o"
option with Unix compilers, it specifies the name of the output file if
it is different from the default (which is the name of the first file
read in with the "f" command).

>then "g", and it complains of unresolved references to 
>"SUB1" and "SUB2" even though they should be found.

Only if you tell the linker to find them.

>So, how am I suppossed to be linking this stuff?  Also,
>Microsoft has done a horrible job with this product in
>my opinion - I'm using it since the it is the only
>Macintosh Fortran the University has.  

It is an obsolete product.  MS has dropped it and it is now sold by the
developer, Absoft.  The current version is 2.4 I believe.

-- 
William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
UUCP=..!{uunet|watmath}!dalcs!biomel!bill
BITNET=bill%biomel%dalcs@dalac	InterNet=bill%biomel@cs.dal.ca