在运行时删除对dll文件依赖的Visual Studio的设置 [英] Settings of Visual Studio to remove dependency on a dll file during runtime
问题描述
有几个选项可用:
-
从项目中删除导入库文件。转到Visual Studio链接器设置并删除条目(
属性 - >链接器 - >输入
)。 -
如果库由
#pragma comment(lib:xxxx)指定
( http://support.microsoft.com/kb/153901 ),然后从源文件中删除该行并重建应用程序。 -
如果您真的想使用库,但只有满足某些运行时条件,才能使用
1。
或2。
以上,但更改您的源代码以使用LoadLibrary
和GetProcAddress
动态加载库并在运行时获取函数指针。
还有一个名为延迟加载的DLL的
。如果这是您以后的信息,请点击以下链接: http: //msdn.microsoft.com/en-us/library/151kt790.aspx
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.
Several options are available:
Remove the import library file from your project. Go to the Visual Studio linker settings and remove the entry (
Properties -> Linker -> Input
).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.If you really want to use the library, but only if certain runtime conditions are met, then use
1.
or2.
above, but change your source code to useLoadLibrary
andGetProcAddress
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
这篇关于在运行时删除对dll文件依赖的Visual Studio的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!