0

This is a super common issue on here, but it seems to be the most arbitrary also. It seems that a million different things can cause it.

After running build after build in RELEASE mode on 64 bit VS2012, I now get a opencv_core249.dll is missing from your computer.

I have not changed my PATH directory, I've also not changed any properties of my program. I haven't even changed any code.

Any ideas? I restarted Visual Studio but to no avail. Also, it builds in RELEASE no problem; it just won't run. It works perfectly in DEBUG, and another project using the exact same property sheet works no problem.

UPDATE: Copying and pasting all the necessary DLLs to the target output directory solves the problem....but surely there's a better way?

marcman
  • 3,233
  • 4
  • 36
  • 71
  • Check that the working directory is set to where the dll files are. There are different working directories for release and debug assuming you're running both in the ide. – Retired Ninja May 22 '15 at 04:00
  • Do you actually have opencv_core249.dll somewhere in the path? I don't use VS, but maybe it was updated and hence not named the same. –  May 22 '15 at 04:01
  • @WilliamKappler Yes I do. I don't think that's the issue – marcman May 22 '15 at 04:02
  • @RetiredNinja: I think you're on to something... How do I play with the working directory of DLLs? Because when I copied and pasted all of the DLLs to the output target directory, it solved my problem. Is there a way to build that into the executable or link to it properly? – marcman May 22 '15 at 04:03
  • just copy and paste them into the same folder as the exe, or add them as correct include paths – GPPK May 22 '15 at 06:10
  • @GPPK to avoid copy/paste, what's the proper line in properties to add them to? – marcman May 22 '15 at 06:11

1 Answers1

0

When you develop programs in visual studio, you set up variables like include path and additional libraries which can be found in the properties for the particular project. These includes are used throughout the project and allow you to have the correct libraries.

Quite often when you finish your development you want to run your exe without the backup of an IDE, this is when you get errors like this.

So why do you get these errors?

This is to do with the difference between static and dynamic linking. OpenCV libs are normally dynamically linked, in which the libraries are given a path name.

And how can I use the libs without copy/pasting them?

Well you need to move towards static linking, a much better explanation than I can type can be found here. Static linking is compiling the libraries into your executable so it has all the information it needs without having to rely on other dll files.

Community
  • 1
  • 1
GPPK
  • 6,546
  • 4
  • 32
  • 57