Settings of Visual Studio to remove dependency on

2020-04-24 10:57发布

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.

1条回答
我想做一个坏孩纸
2楼-- · 2020-04-24 11:56

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

查看更多
登录 后发表回答