home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:13413 comp.lang.fortran:3501
- Path: sparky!uunet!sun-barr!olivea!hal.com!darkstar.UCSC.EDU!gross
- From: gross@maxwell.ucsc.edu (Mike Gross)
- Newsgroups: comp.lang.c,comp.lang.fortran
- Subject: mixing C/Fortran and shared libraries
- Message-ID: <18m1jcINN9qs@darkstar.UCSC.EDU>
- Date: 9 Sep 92 23:33:00 GMT
- Organization: University of California, Santa Cruz
- Lines: 42
- NNTP-Posting-Host: maxwell.ucsc.edu
-
- Hello, netters!
- I've been having a rather nasty problem trying to integrate a Fortran
- object library into a C program. The compilers and linker seem quite happy
- with the code and my makefiles, but when I run the program, I get the
- following error message from ld.so:
-
- ld.so: call to undefined procedure __fp_convert_double_to_int from 0xf757311c
-
- I looked in libm.a (both Fortran and C versions) and this routine was
- present in both of them. What seems to be happening is that at compile time,
- the loader thinks it doesn't need this particular routine, so it doesn't link
- it in. But somewhere along the line at runtime, the dynamic loader realizes
- this is a mistake and tries to get it. The problem: there is no libm.so.*.
-
- I tried to find out what this routine was for. The obvious answer is that
- it's a typecast of some sort. I tried writing a Fortran routine that
- calculated pi in double precision and cast it to an integer*4. This made
- no difference. I even tried calling the routine directly, and this didn't
- help.
-
- I'm at the end of my rope now, since my C program is getting rather large,
- and I don't have source code to the Fortran library (it's Mongo 1987 for
- those familiar with it). Does anyone out there have any idea what's going
- on?
-
- If it matters, I'm using GNU cc, version 2.2.2 on a Sparc IPC running
- SunOS 4.1.1. The Fortran compiler is Sun's second ("SC1.0") supposedly
- fixed f77. There is, of course, the possibility that the library was
- compiled under an older f77 (since I didn't compile it myself).
-
- Any help would be tremendously appreciated.
-
- Michael Gross Until Oct. 15:
- 312 Natural Sciences II c/o Keith Jahoda
- Univ of California NASA/Goddard Space Flight Center
- Santa Cruz, CA 95064 Code 666
- (408) 459-4588 Greenbelt, MD 20771
- gross@maxwell.ucsc.edu gross@ros1.gsfc.nasaa.gov
-
-
-
-
-