Article View: comp.std.c
Article #3321Re: Libraries specified in source?
From: euphausia superba
Date: Tue, 26 Jan 1993 18:50
Date: Tue, 26 Jan 1993 18:50
22 lines
1241 bytes
1241 bytes
In comp.std.c, ray@astro.ocis.temple.edu (Ray Lauff) writes:
|
| #library "/lib/libc.a"
Upon seeing
#include <math.h>
in the program the compiler has enough information to realize that it
might be a good idea to add -lm to the link phase. Failing that, it
should be simple to use makedepend(1) to get a list of all include
files your program uses and look up in a database what libraries are
needed. Add a bit more info to the database to establish the ordering
of libraries on the command line and there ya go. I agree, it would be
a nifty feature to have built into a compiler, but I see no need to add
another preprocessor directive to accomplish the task.
Another approach: the machine I use has about 40 or so libraries all in
all; I could simply mention all of them on the command line and the linker
would "do the right thing," slowly though.
the krill
Technical Details
Message-ID:
<2227@ontek.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!ontek!mikeyReferences:
<1993Jan21.182949.29796@cronkite.ocis.temple.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ontek!mikey From: mikey@ontek.com (euphausia superba) Newsgroups: comp.std.c Subject: Re: Libraries specified in source? Message-ID: <2227@ontek.com> Date: 26 Jan 93 18:50:57 GMT References: <1993Jan21.182949.29796@cronkite.ocis.temple.edu> Organization: Ontek Corporation -- Laguna Hills, California Lines: 23