Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!cornell!rochester!PT!sei!sei.cmu.edu!kwh From: kwh@sei.cmu.edu (Kurt Hoyt) Newsgroups: comp.sys.ibm.pc Subject: Re: Mixed language programs Message-ID: <2641@aw.sei.cmu.edu> Date: Sat, 26-Sep-87 22:16:28 EDT Article-I.D.: aw.2641 Posted: Sat Sep 26 22:16:28 1987 Date-Received: Sun, 27-Sep-87 12:04:50 EDT References: <582@uvm-gen.UUCP> Sender: netnews@sei.cmu.edu Lines: 34 Keywords: Problem is linking In article <582@uvm-gen.UUCP> haviland@uvm-gen.UUCP (Tom Haviland) writes: > > I have an interesting problem I wonder if anyone out there might have >experienced. I'm writing a menu system to go with a fortran modelling >package, and since supposedly microsoft C and FORTRAN work together, I >wrote the menu system in C. I've set up an INTERFACE block in the fortran >program to call the C routines, and it seems to call the routine ok, but >when the C routine calls the fscanf() function, reading floating point >numbers from a file (%f) I get an error "Floating point not loaded" and >the program stops. Now the C routines do some floating point calculations > Thomas P. Haviland Your problem isn't in the compiling -- its in the linking. If you link from FORTRAN instead of from cc, the proper library for scanf/printf for floating point numbers isn't linked. See page 367 of the C compiler user's guide manual: "Your program needs the foating-point library, but the library was not loaded. The error causes the program to terminate with an exit status of 255." You need to link in the C floating point library when you link. FORTRAN won't know that you need the C floating point library. Hope this helps. It is a common error when mixing languages. I ran into similar problems mixing C and Ada because Ada didn't link in some startup code that the C code needed, so I had to explicitly tell Ada to link in the C startup code. -- "Why isn't anyone ever happy to | Kurt Hoyt see us?" | ARPA: kwh@sei.cmu.edu -- Arthur Dent | BITNET: kwh%sei.cmu.edu@cmuccvma | CSNET: kwh%sei.cmu.edu@relay.cs.net