user992520
user992520

Reputation:

how to include opencv dlls in order for exe to run

I am wondering how do I allow my OpenCV project exe file to run on other Windows 7 machines without modifying other pcs. It runs on mine as I have all the libs installed. Can I embed the necessary files into the folder with the exe file?

Upvotes: 5

Views: 4743

Answers (2)

Jav_Rock
Jav_Rock

Reputation: 22245

You should create a folder ( ...project/libs, for example), put the libraries in it and in VisualStudio (I guess you are using VS), in Configuration Properties -> Linker -> General -> Additional Libraries Directories set a relative path this way:

"$(SolutionDir)\libs"

Where $(SolutionDir) is the path of your project. The environmet variable can be created in Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables. Then just click New and add the path and the variable name ( SolutionDir).

Upvotes: 3

Sam
Sam

Reputation: 20056

You can put all the needed dll's in the same folder as your exe, or put them in a different folder (let's say C:/Programs/OpenCV/bin) and add this path into the System PATH.

To set PATH, go to My-Computer - Properties, Advanced system settings -> environment variables, and look for Path. Add yours, and do not forget to separate it with a ";".

Upvotes: 2

Related Questions