Re: Why NOT to link using pragma comment (lib, libname)
- From: "Ed Weir \(ComCast\)" <Anon@xxxxxxxx>
- Date: Mon, 11 Sep 2006 22:02:20 -0700
"beauwlf" <beauwlf@xxxxxxxxxxx> wrote in message
news:4506190c_2@xxxxxxxxxxxxxxxxx
| Hi Ed
|
| > Libs are arguably by definition 'to be shared' across multiple projects;
| > it
| > is often inconvenient to add the lib to every project which uses the lib
| > especially since most libs are pretty well 'cooked' and require rare
| > updates. Using the #pragma in the header file for the library affords
you
| > the convenience of just sharing the header file without having to add
the
| > lib to the dependency list. You can still maintain the lib under its
| > parent
| > project, and just relink your project list manually if the lib is ever
| > updated. That at least, is the basic rationale for the #pragma
directive
| > in
| > this case. If every project has the lib in its dependency list the
| > dependencies will have to be checked for every project build. This may
| > seem
| > trivial, but consider hundreds of projects in a build which takes hours
to
| > complete.
| >
| > -- Ed.
|
| I am using the #pragma to remove the necessity of adding the lib into the
| dependency list.
| Currently i force the project to update its link to the modified lib by
| purposely editing the project code. This way you can be sure that your
| project had updated its link to the modified lib.
| Is there a better way to update project link to its lib ?
|
| Regards
Rebuild all?
If you don't have a very long list of projects that depend on the lib, just
put it in as a dependency. The #pragma is good for shortening build times
for large project lists that all depend on the same lib or list of libs. As
with all tools, #pragma has its place - it's good to understand the purpose
for its use... Note that the two methods are not mutually exclusive either.
-- Ed.
-----------------------------------------------------
In dictatorships, you need courage to fight evil; in the free world, you
need courage to see the evil."
—Natan Sharansky
F9E7707A2AF502D0A899C6ACB43A2D35EB7E->bin->b64
.
- References:
- Re: Why NOT to link using pragma comment (lib, libname)
- From: Ed Weir \(ComCast\)
- Re: Why NOT to link using pragma comment (lib, libname)
- From: beauwlf
- Re: Why NOT to link using pragma comment (lib, libname)
- Prev by Date: Re: Difficulty importing library with VC++
- Next by Date: Re: NT Service Problem
- Previous by thread: Re: Why NOT to link using pragma comment (lib, libname)
- Next by thread: Re: Why NOT to link using pragma comment (lib, libname)
- Index(es):
Relevant Pages
|