home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / fortran / 4296 < prev    next >
Encoding:
Internet Message Format  |  1992-11-11  |  4.1 KB

  1. Xref: sparky comp.lang.fortran:4296 comp.os.msdos.programmer:10545
  2. Newsgroups: comp.lang.fortran,comp.os.msdos.programmer
  3. Path: sparky!uunet!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!btbg1194
  4. From: btbg1194@uxa.cso.uiuc.edu (Bradley T Banko)
  5. Subject: Mixed Language MS C calls MS FORTRAN 5.1 (DOS) (help!)
  6. Message-ID: <BxJIvH.2J9@news.cso.uiuc.edu>
  7. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  8. Organization: University of Illinois at Urbana
  9. Date: Wed, 11 Nov 1992 07:16:27 GMT
  10. Lines: 77
  11.  
  12.  
  13. I am having some problems trying to do some mixed language programming
  14. using MS C (5.0) to call MS FORTRAN (5.1) functions.  I think that I have
  15. sorted out all of the "language interface" problems (passing C variables
  16. by reference, etc.) and I have one C test program which compiles and links
  17. and runs with the Fortran subroutines just fine.  
  18. I wrote a second program to test the Fortran subroutines, and I get a 
  19. bunch of *link* time errors:
  20.  
  21.     L2025 symbol defined more than once
  22.  
  23. and finally, it tells me that the fortran subroutine interface prototypes
  24. are improper or missing.  There is almost *no* difference between these
  25. two simple test programs.
  26.  
  27. I have the libraries LLIBFORE.LIB and LLIBCE.LIB in the path, and have used
  28. both the V3.61 and V5.16 linkers with similar results.
  29.  
  30. I compile the FORTRAN file with:
  31.  
  32.         fl /c file.for    (I have tried "fl /FPc /c" also)
  33.  
  34. I compile the C program with:
  35.  
  36.         cl /AL /c cfile.c
  37.  
  38. and link with:
  39.  
  40.         link cfile+cfile,,,,,,,,    (all defaults)
  41.  
  42. in the case of one test program, I get a bunch of "symbol redefined errors",
  43. and in the second case I get *no* errors.  (I will include the linker outputs
  44. below for the curious.)
  45.  
  46. Thanks in advance for any advice or comments to:  b-banko@uiuc.edu
  47.  
  48. Brad Banko
  49.  
  50. tstrdwrt.c:
  51. ======================================================================
  52. Microsoft (R) Segmented-Executable Linker  Version 5.15
  53. Copyright (C) Microsoft Corp 1984-1991.  All rights reserved.
  54.  
  55. Object Modules [.OBJ]: /NOE tstrdwrt rdwrtcp,,,,,
  56. ======================================================================
  57.  
  58. rwcopy.c:
  59. ======================================================================
  60. Microsoft (R) Segmented-Executable Linker  Version 5.15
  61. Copyright (C) Microsoft Corp 1984-1991.  All rights reserved.
  62.  
  63. Object Modules [.OBJ]: /NOE rwcopy rdwrtcp,,,,,C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0.asm) : error L2025: __aexit_rtn : symbol defined more than once
  64. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0.asm) : error L2025: __asizds : symbol defined more than once
  65. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0.asm) : error L2025: __astart : symbol defined more than once
  66. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0.asm) : error L2025: __atopsp : symbol defined more than once
  67. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0.asm) : error L2025: __cintDIV : symbol defined more than once
  68. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0.asm) : error L2025: __amsg_exit : symbol defined more than once
  69. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0dat.asm) : error L2025: __osversion : symbol defined more than once
  70. ...
  71. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0dat.asm) : error L2025: __umaskval : symbol defined more than once
  72. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0dat.asm) : error L2025: __ctermsub : symbol defined more than once
  73. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0dat.asm) : error L2025: __doserrno : symbol defined more than once
  74. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0dat.asm) : error L2025: __fac : symbol defined more than once
  75. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0dat.asm) : error L2025: _exit : symbol defined more than once
  76. C:\FORTRAN\LIB\LLIBFOR7.lib(dos\crt0dat.asm) : error L2025: __psp : symbol defined more than once
  77.  
  78. rwcopy.obj(rwcopy.c) : error L2052: '_readfl' : unresolved external; possible calling convention mismatch
  79. rwcopy.obj(rwcopy.c) : error L2052: '_writfl' : unresolved external; possible calling convention mismatch
  80.  
  81.  
  82. There were 72 errors detected
  83. ======================================================================
  84. -- 
  85. Brad Banko;  Dept of Physics;  U of Illinois;  b-banko@uiuc.edu
  86. =========================================================================
  87. Tatiana Gutsu for President!                     73 de kb8cne @ n9lnq.il
  88. Wanted:  Italian pagan Catholic woman.  Inquire within.
  89.