home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / std / c / 3411 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.8 KB  |  46 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!wupost!uwm.edu!linac!att!att!dptg!ulysses!ulysses.att.com!gsf
  3. From: gsf@ulysses.att.com (Glenn S. Fowler)
  4. Subject: Re: Libraries specified in source?
  5. Message-ID: <1993Jan25.051319.17737@ulysses.att.com>
  6. Date: Mon, 25 Jan 1993 05:13:19 GMT
  7. References: <1993Jan21.182949.29796@cronkite.ocis.temple.edu> <1993Jan23.194202.20332@druid.uucp>
  8. Organization: AT&T Bell Labs
  9. Lines: 35
  10.  
  11. In article <1993Jan23.194202.20332@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes:
  12. >ray@astro.ocis.temple.edu (Ray Lauff) writes:
  13. >>but why not just have a line in the main program such as
  14. >>
  15. >>#library "/lib/libc.a"
  16. >
  17. >Two problems I can think of right off.  How do you know that the
  18. >function you want is in that library on every system and how do
  19. >you know that the libraries reside in that directory?
  20. >> ...
  21. >How is this easier than using the Make file?
  22.  
  23. something like #[pragma] library would be very useful for providers of
  24. non standard libraries
  25.  
  26. [warning -- concrete example follows]
  27.  
  28. take unix sockets (or leave them)
  29. on BSD derived systems
  30.     #include <sys/socket.h>
  31. in the source is sufficient because all the gunk is in libc
  32. but on sys5r4 you need to link with -lsocket -lnsl (and maybe some others)
  33. while on 10th edition you need -ltcp -lyou-get-the-picture
  34.  
  35. if the <sys/socket.h> provider uses #[pragma] library ... then
  36. no makefile mods are needed and the provider can partition the
  37. library objects any which way, even change them from release to release
  38.  
  39. however I would prefer a notation that more closely follows the unix cc
  40. -l option that abstracts the library name out of the file system namespace
  41.     #pragma library "socket"    /* -lsocket */
  42.     #pragma library "nsl"        /* -lnsl */
  43.  
  44. Glenn Fowler    (908)-582-2195    AT&T Bell Laboratories, Murray Hill, NJ
  45. uucp: {att,ucbvax}!ulysses!gsf              internet: gsf@ulysses.att.com
  46.