home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / alt / msdos / programm / 2718 < prev    next >
Encoding:
Text File  |  1992-11-12  |  4.0 KB  |  88 lines

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