home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / hp / 10309 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  2.3 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!spool.mu.edu!sdd.hp.com!scd.hp.com!cupnews0.cup.hp.com!hppad.waterloo.hp.com!hppad!hpfcso!mjs
  2. From: mjs@hpfcso.FC.HP.COM (Marc Sabatella)
  3. Newsgroups: comp.sys.hp
  4. Subject: Re: Motif and regcmp
  5. Message-ID: <7371306@hpfcso.FC.HP.COM>
  6. Date: 11 Sep 92 20:37:54 GMT
  7. References: <5476@dove.nist.gov>
  8. Organization: Hewlett-Packard, Fort Collins, CO, USA
  9. Lines: 43
  10.  
  11. In comp.sys.hp, fein@epg.nist.gov (Aaron Fein) writes:
  12.  
  13. > I was able to successfully compile and link a Motif application, but when I
  14. > run it I get a message saying "Unable to resolve regcmp (code)..."  (Why 
  15. > wasn't this caught by the linker?)
  16.  
  17. Shared libraries make this type of determination more difficult.  Sun is overly
  18. aggressive, complaining about missing routines referenced anywhere in any
  19. shared library, needed or not; HP-UX on the 700 and 800 series is overly
  20. conservative, not complaining about some routines by shared libraries.  The
  21. 300/400 linker tries its best to give the right answers, but it can probably be
  22. fooled in either direction by a wicked enough programmer.  A surprisingly nasty
  23. problem, actually.
  24.  
  25. > So I added in the PW library in the link.
  26. > The link failed with a message about unsatisfied symbols: free and write. 
  27. > I am trying to figure out in what library free and write are located and 
  28. > why are they no longer found once I add the PW library in the link.  
  29. > I have tried -lc -lPw -lc as suggested and this did not link either.
  30.  
  31. Sounds similar to another problem posted on yesterday - see if you can find my
  32. response.  "free" and "write" are indeed in libc, but apparently the linker
  33. thinks it doesn't need them the first time it searches the library, and doesn't
  34. bother looking again.  My suggestion (which was lacking in my response to the
  35. other related problem): try "-Wl,-a,archive" after the "-lc -lPW".  The second
  36. "-lc" is unnecessary; the compiler inserts that for you.  If the linker does
  37. ignore repeated shared libraries, then the trick is probably to specify the
  38. archive form for one or the other.  If you have problems with
  39.  
  40.     -lc -lPW -Wl,-a,archive
  41.  
  42. try
  43.  
  44.     -Wl,-a,archive -lc -Wl,-a,default -lPW
  45.  
  46. which will search archive libc the first time instead of the second.
  47.  
  48. --------------
  49. Marc Sabatella (marc@hpmonk.fc.hp.com)
  50. Disclaimers:
  51.     2 + 2 = 3, for suitably small values of 2
  52.     Bill (H.) and Dave (P.) may not always agree with me
  53.