Re: Why NOT to link using pragma comment (lib, libname)

Tech-Archive recommends: Speed Up your PC by fixing your registry



"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

.



Relevant Pages

  • SPS Content Approval
    ... I read in the help file that Content approval allows you ... Manage Lists right. ... Site level and not at the Portal level. ... lib. ...
    (microsoft.public.sharepoint.portalserver)
  • Re: newbie: foreach
    ... (but I'm sure the 3 library lists could be declared as a single list somehow, ... foreach lib $libs ... There's not much point in doing that, unless there's a chance that you'll add more libraries in the future and you're concerned that you'll forget to update one of the foreach statements. ...
    (comp.lang.tcl)
  • Re: Offline browsing of SharePoint site/content
    ... Sorry replying so late. ... lib, Image lib, lists. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Adding references to external DLLs
    ... Use comment pragma instead: ... Note it is not a .DLL but a .LIB ... ... I created a basic VC++ project and added a call to HidD_GetHidGuidwith a prototype from hid.dll, along with necessary header files. ... How can I add a reference to hid.dll to make this error go away? ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Differences between CLI command line and CLI control lib project!?
    ... DirectShow: ... #pragma comment (lib, "strmiids.lib") ... If I use the same code in my CLI control library project, ...
    (microsoft.public.dotnet.languages.vc)