Tahlil
Tahlil

Reputation: 2731

Settings of Visual Studio to remove dependency on a dll file during runtime

Everywhere people are suggesting how to let visual studio know when visual studio at run time doesn't find a dll. But I want to know where do I remove the option so that visual studio at run time doesn't try to find a dll file? I have a similar question about it yesterday with no answer in here.

Upvotes: 2

Views: 3970

Answers (1)

PaulMcKenzie
PaulMcKenzie

Reputation: 35455

Several options are available:

  1. Remove the import library file from your project. Go to the Visual Studio linker settings and remove the entry (Properties -> Linker -> Input).

  2. If the library is specified by a #pragma comment(lib:"xxxx") (http://support.microsoft.com/kb/153901), then remove that line from your source file(s) and rebuild your application.

  3. If you really want to use the library, but only if certain runtime conditions are met, then use 1. or 2. above, but change your source code to use LoadLibrary and GetProcAddress to dynamically load the library and obtain the function pointers at runtime.

There is also a thing called Delay Loaded DLL's. If this is what you're after, here is the link to the information: http://msdn.microsoft.com/en-us/library/151kt790.aspx

Upvotes: 2

Related Questions