简体   繁体   中英

How to make package of .exe file with required .dll and lib (opencv) files in visual studio 2010 C++

I have created an opencv project which include path having headers,*.lib and *.dll files of opencv in project properties and I have hard coded path of header files of opencv in .cpp that I have created.Let us say I need to give this project to customer,hence I only need to give .exe file of execution directly in customer system.

so please anyone help how I can do packaging of path of .dll and .lib along with my project .exe file. or are there any other way where i can send .exe file to customer which comprises of all ie can execute opencv and also my logic in customers system.

thanks in advance and sharing answer is always appreciable.

Either use relative paths for everything you're using and ship them along ( if you're allowed to , check the licenses first!!), or if you need to give your users the source code (as a VS solution) and you can't/don't want to hardcode the paths of your tools use CMake to generate the solution files.

If you need to package binaries together along with your executable (and still, you're allowed to), you can use an installer packaging app like Inno Setup

You need to make sure every dependency needed by your application is shipped otherwise your customers won't be able to run your software. To find out dependencies in a Win environment, try to use the dependency tool shipped with each copy of visual studio.

As a sidenote: you shouldn't be putting complete absolute paths in the include directives, eg

#include "C:\mysystem\helloworld\app\opencv\header.h"

because that is the sure recipe for compilation problems or unnecessary preprocessing when deploying or redistributing your sources. This doesn't apply to binaries: they just need to find the compiled dependencies/tools they need.

Visual Studio 2010 Does not provide the package creation for C++.

In My Opinion you have to use third party software like [Advanced Installer] 1 who search for the required dll and provide us to create the package as an installer.

And for the paths you have included in the Header.

If You Have a .exe then it does not matter for running your application.

Hope this will help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM