home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4740 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.7 KB

  1. Path: pn.itnet.it!not-for-mail
  2. From: "Stefano Agostinelli" <agos001@pn.itnet.it>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Shared Lib problems
  5. Date: Fri, 01 Mar 1996 14:27:16 +0100
  6. Organization: ITnet
  7. Message-ID: <65641307%agos001@pn.itnet.it>
  8. References: <65641284%agos001@pn.itnet.it> <DnJEs1.Lr0@unx.sas.com>
  9. NNTP-Posting-Host: agos001.pn.itnet.it
  10. X-NewsReader: IntuiNews 1.3 (27.8.95)
  11.  
  12. Doug Walker wrote in comp.sys.amiga.programmer about "Re: Shared Lib problems":
  13. > stdio works IF your shared library was linked with libinitr.o.  If you
  14. > linked with libinit.o instead of libinitr.o, stdio will not work.  I
  15. > believe libinitr.o was added in the 6.50 version, so if you have an
  16. > earlier version, you won't be able to use stdio from a shared library.
  17.  
  18.  Yes I'm using SAS/C 6.5x and yes my library was linked with libinit.o
  19.  
  20. > >slink with amiga.lib first of sc.lib,so I've done but the linker
  21. > >just reports a multiple definition error (on Boopsi functions btw),so
  22. > >what should I do in order to use amiga.lib stdio functions?
  23. > Don't use the amiga.lib sprintf, use its Sprintf.  There is a DOS function
  24. > Sprintf that does not conflict with the ANSI namespace that the compiler
  25. > uses.  In my opinion, it was a horrible mistake for Commodore to put
  26. > non-ANSI functions in their library that have ANSI names, but that's water
  27. > under the bridge.
  28.  
  29.  Sprintf? There is or there should be?I see DOS has something called VFPrint
  30.  and VPrintf (amiga.lib FPrintf and Printf) but no VSprintf (or Sprintf in
  31.  amiga.lib).
  32.  However yes you're right,those conflicts are quite confusing for beginner
  33.  grade programmer (the category I belong to :).
  34.  However amiga.lib sprintf is so tiny that it's rather useful: it's about
  35.  1K shorter than the full fledged SAS/C ANSI one.
  36.  
  37. > I don't know what the deal is with your multiple definition error, I'd have
  38. > to see more information.  Your exact link command line (whether with SC or
  39. > SLINK) would help, as would the error or warning message(s) that you are
  40. > getting.
  41.  
  42.  Command I use is:
  43.  "slink ... lib:amiga.lib lib:sc.lib ..."
  44.  or
  45.  "sc ... link lib=small.lib ...".
  46.  
  47.  I get these errors from the linker. However please note that the library
  48.  is correctly built and indeed sprintf works!
  49.  
  50. ---CUT---
  51. Pass1 for Library 'lib:amiga.lib'
  52. Pass1 for Library 'LIB:sc.lib'
  53. ERROR: Multiply defined symbol '_DoMethod'.
  54.        First defined in file 'lib:amiga.lib'.
  55.         Type = RELOCATABLE   Value = 0
  56.        Redefined in file 'LIB:sc.lib'.
  57.         Type = RELOCATABLE   Value = 0
  58. ERROR: Multiply defined symbol '_DoSuperMethod'.
  59.        First defined in file 'lib:amiga.lib'.
  60.         Type = RELOCATABLE   Value = 20
  61.        Redefined in file 'LIB:sc.lib'.
  62.         Type = RELOCATABLE   Value = 20
  63. ERROR: Multiply defined symbol '_CoerceMethod'.
  64.        First defined in file 'lib:amiga.lib'.
  65.         Type = RELOCATABLE   Value = 46
  66.        Redefined in file 'LIB:sc.lib'.
  67.         Type = RELOCATABLE   Value = 46
  68. ERROR: Multiply defined symbol '_SetSuperAttrs'.
  69.        First defined in file 'lib:amiga.lib'.
  70.         Type = RELOCATABLE   Value = 150
  71.        Redefined in file 'LIB:sc.lib'.
  72.         Type = RELOCATABLE   Value = 170
  73. Pass1 for Library 'LIB:amiga.lib'
  74. ---CUT---
  75.  
  76. Many thanks for your help!
  77.  
  78.  Regards
  79. Stefano
  80.  
  81. +--------------------------+-------------------------------------------+
  82. | Stefano Agostinelli      | Now developing for You ARM :              |
  83. | Physics Dep. - Genoa     | the state of art Amiga Role Master System |
  84. +--------------------------+-------------------------------------------+
  85. | IRC: arm                 | WWW: www.geocities.com/SiliconValley/3630 |
  86. | E-M: agos001@pn.itnet.it | Look at Stefano.html and ARM.html         |
  87. +--------------------------+-------------------------------------------+
  88.  
  89.