Visual Studio的设置在运行时删除对dll文件的依赖 [英] Settings of Visual Studio to remove dependency on a dll file during runtime
问题描述
无处不在的人们建议如何让视觉工作室知道什么时候视觉工作室在运行时没有找到一个DLL。但我想知道我在哪里删除该选项,所以Visual Studio在运行时不试图找到一个dll文件?我昨天有一个类似的问题,在
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.
推荐答案
有几种选择:
-
从您的项目中删除导入库文件。转到Visual Studio链接器设置并删除条目(
属性 - >链接器 - >输入
)。
如果库由 #pragma注释指定(lib:xxxx)
( http://support.microsoft.com/kb/153901 ),然后从源文件中删除该行并重新构建您的应用程序。
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.
如果你真的想使用库,但是只有当满足某些运行时条件,然后使用 1。
code> 2。,但更改您的源代码以使用 LoadLibrary
和 GetProcAddress
动态加载库并在运行时获取函数指针。
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.
c $ c>延迟加载DLL的。如果这是您要的,请点击以下链接: http: //msdn.microsoft.com/en-us/library/151kt790.aspx
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
这篇关于Visual Studio的设置在运行时删除对dll文件的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!