home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / std / c / 3441 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.2 KB

  1. Path: sparky!uunet!ontek!mikey
  2. From: mikey@ontek.com (euphausia superba)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Libraries specified in source?
  5. Message-ID: <2227@ontek.com>
  6. Date: 26 Jan 93 18:50:57 GMT
  7. References: <1993Jan21.182949.29796@cronkite.ocis.temple.edu>
  8. Organization: Ontek Corporation -- Laguna Hills, California
  9. Lines: 23
  10.  
  11. In comp.std.c, ray@astro.ocis.temple.edu (Ray Lauff) writes:
  12. | #library "/lib/libc.a"
  13.  
  14. Upon seeing
  15.  
  16.   #include <math.h>
  17.  
  18. in the program the compiler has enough information to realize that it
  19. might be a good idea to add -lm to the link phase.  Failing that, it
  20. should be simple to use makedepend(1) to get a list of all include
  21. files your program uses and look up in a database what libraries are
  22. needed.  Add a bit more info to the database to establish the ordering
  23. of libraries on the command line and there ya go.  I agree, it would be
  24. a nifty feature to have built into a compiler, but I see no need to add
  25. another preprocessor directive to accomplish the task.
  26.  
  27. Another approach: the machine I use has about 40 or so libraries all in
  28. all; I could simply mention all of them on the command line and the linker 
  29. would "do the right thing," slowly though.
  30.  
  31.       the krill
  32.  
  33.