Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ VC++ OpenCV
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.
Posted 7-Nov-12 18:31pm
Kumar 091.2K
Edited 8-Nov-12 1:43am
Legor5.6K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Kumar 09 at 8-Nov-12 23:31pm
   
hi Richard thank you for the reply,
 
one point i want to clear you is that when i build application using opencv dll's its working fine in my computer, whereas when i run the same application in other computer it is asking for the opencv dll's. Is there any other way that every time we dont copy these dll's in to other computer and run the application.
 
Thank u again in advance.
Richard MacCutchan at 9-Nov-12 5:29am
   
No, I am afraid that is how the Windows system works. If you wish to use 3rd party DLLs in your application then you must install them with your application. The only alternative is to use static libraries, which you have already discovered is not possible.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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/[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 375
1 Sergey Alexandrovich Kryukov 329
2 CPallini 260
3 DamithSL 214
4 Maciej Los 197
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 8 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100