在运行时删除对dll文件依赖的Visual Studio的设置 [英] Settings of Visual Studio to remove dependency on a dll file during runtime

查看:539
本文介绍了在运行时删除对dll文件依赖的Visual Studio的设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人都在建议如何让视觉工作室知道当视觉工作室在运行时没有找到一个dll。但是我想知道我在哪里删除选项,以便visual studio在运行时不会尝试找到一个dll文件?昨天我有一个类似的问题,在

解决方案

有几个选项可用:


  1. 从项目中删除导入库文件。转到Visual Studio链接器设置并删除条目(属性 - >链接器 - >输入)。


  2. 如果库由 #pragma comment(lib:xxxx)指定 http://support.microsoft.com/kb/153901 ),然后从源文件中删除该行并重建应用程序。


  3. 如果您真的想使用库,但只有满足某些运行时条件,才能使用 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:

  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

这篇关于在运行时删除对dll文件依赖的Visual Studio的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆