Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!sunic!tut!santra!tuura!risto From: risto@tuura.UUCP (Risto Lankinen) Newsgroups: comp.sys.ibm.pc Subject: Re: How do I call MS FORTRAN from MS C? Message-ID: <614@tuura.UUCP> Date: 7 Feb 90 10:34:10 GMT References: <7894@lindy.Stanford.EDU> Organization: Nokia Data Systems Oy Lines: 26 LC.YRS@forsythe.stanford.edu (Richard Stanton) writes: >If I have a .OBJ file that apparently is a compiled MS FORTRAN >subroutine, how do I link it into a MS C main program? I have tried >declaring the function name with the "fortran" keyword, but the >linker keeps wanting to look for FORTRAN.LIB, and complains about a >few doubly defined symbols. I also get a few segment fixup errors, >and the program does not run. >What am I missing? I think you're missing the FORTRAN.LIB :-> Seriously, the .OBJ created by the Fortran compiler seems to have references to the library file of the compiler. There may (and almost certainly is) a call to a function, to which Fortran could not generate intrinsic code but used a call instead. Now that you do not have (do you?) the FORTRAN.LIB, the linker (and *not* the C-compiler) does not know where to find code for that/those external call/-s. The fix is to use the FORTRAN.LIB of the compiler the .OBJ was done with, then compile the C-code and to offer the FORTRAN.LIB as an additional library to search code for external calls to the LINKer. terveisin: Risto Lankinen --