包括dll在visual studio c ++ 2008 [英] include dlls in visual studio c++ 2008

查看:189
本文介绍了包括dll在visual studio c ++ 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法来包括dll在一个项目,所以我不要把这些DLL在同一个文件夹中我的可执行文件编译后。
这种方式我可以与他们编译我的项目。这是一个可能性,如果是有人可以指导我。

Is there a way to include dlls in a project so that I don'thave to put those dlls in the same folder with my executable after compiling. This way I could just compile my project with them. Is this a possibility and if yes could someone guide me.

我的项目是一个opencv项目,有很多dll,我必须包括在文件夹,不知道他们是否是.NET程序集,因为我读了另一篇文章说,它可以用.NET程序集dll。

My project is an opencv project and there are many dlls that I would have to include in the folder, and I don't know whether they are .NET assemblies or not, since I read an other post which said that it can be done with .NET assembly dlls.

推荐答案

我理解你想做的是部署你的exe文件及其依赖(dll),但你也希望它在项目中配置。您可以将项目配置为使用静态库,而不必担心分发DLL,因为它们已经内置到exe中。

I understand that what you wish to do is to deploy your exe file along with its dependencies (dlls), but you also want it to be configured in the project. You can configure your project to use static libraries instead and you don't have to worry about distributing your DLLs because they are already built into the exe.

如果您希望使用DLL,因为您不想膨胀您的exe,那么您的代码将必须实现其加载,即调用LoadLibrary函数和必要的调用具体出口功能。一旦你的代码实现了DLL的加载,然后你可以按照你所描述的方式部署它们。

If you wish to use DLLs because you do not want to bloat your exe then your code will have to implement its loading, i.e. calling LoadLibrary function and the necessary calls to the specific export functions. Once your code has implemented the loading of the DLLs then you can deploy them the way you described.

这篇关于包括dll在visual studio c ++ 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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