如何在可执行文件中嵌入opencv dll [英] how to embed opencv dll's in executable

查看:153
本文介绍了如何在可执行文件中嵌入opencv dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在做一个mfc项目,正在使用opencv dll进行人脸识别.

当我想将EXE文件移植到另一台计算机上时,在我的计算机上可以正常工作

它要求输入opencv dll(cv210d.dll,cvcore210d.dll等)

我的问题是怎么做.

将opencv重新编译为静态库(.lib而不是.dll).那没有用.我收到10个链接器错误.

如果可能,如何将DLL合并/嵌入exe文件.

P.S. -我正在使用Visual Studio 2010,openCV 2.0和基于MFC对话框的应用程序.

Hello,

I am working on a mfc project, where i am using the opencv dll''s for face recognition.

Its working fine in my computer, when i want to port my EXE file to another computer

it asks for opencv dlls (cv210d.dll, cvcore210d.dll, ...)

My question is how to do it.

Recompile opencv as static library (.lib instead of .dll). That didnt work. I get 10 linker errors.

If possible, how to merge/embedd DLL''s into exe file.

P.S. - I am using visual studio 2010, openCV 2.0, and mfc Dialog based Application.

推荐答案

您无法将DLL合并为可执行文件,它们是独立的可加载模块.您需要将它们和可执行文件复制到另一台计算机上.您可以手动执行此操作,也可以通过创建安装程序来执行此操作.您没有提供要重建为静态库的问题的详细信息,因此我们无法提供解决此问题的任何建议.
You cannot merge DLLs into an executable, they are stand-alone loadable modules. You need to copy them with your executable to the other computer. you can do this manually or by creating a setup program. You did not give details of the problems you had trying to rebuild as static libraries so we cannot offer any suggestions to fix that problem.


Richard早就说过,不可能嵌入exe中的DLL,但是您可以复制程序与exe一起依赖的DLL.

看起来,用它的静态库构建openCV目前还不是很容易.我曾尝试自己做过一段时间,但是经过一段时间后,考虑到仅使用DLL会更容易.您可以在openCV的质量检查部分尝试提问
http://answers.opencv.org/questions/ [
As Richard allready stated it''s not possible to embed DLLs in an exe but you can copy the DLLs your program depends along with your exe.

Building openCV with its static libraries isn''t very easy at the moment so it seems. I tried to do this myself a while ago but after some time considered that it would be easier just to stay with the DLLs. You can try and ask at the QA section of openCV
http://answers.opencv.org/questions/[^]


这篇关于如何在可执行文件中嵌入opencv dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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