views:

626

answers:

1

I'm having trouble running basic opencv scripts on my new machine. I've installed opencv2.1. I am linking these files from the linker:

C:\OpenCV2.1\lib\cv210.lib C:\OpenCV2.1\lib\cvaux210.lib C:\OpenCV2.1\lib\cxcore210.lib C:\OpenCV2.1\lib\highgui210.lib

I run the program, it compiles. However, it gives me the error stated above. Why is that? I tried linking to the dll it describes, and it doesn't like that either.

+1  A: 

The DLL needs to be somewhere in the DLL search path, otherwise the loader won't be able to find it.

The two easiest options are to copy the DLL(s) to the directory in which your executable is located or the directory from which you are running your executable, or to add the directory in which the DLL(s) are located to the PATH.

James McNellis
Adding the directory to the PATH sounds ideal, but that doesn't seem to be working. I've added the opencv/bin directory to the path from environment variables and no dice..
tomas
@tomas: After adding to the path you may need to restart Visual Studio, log out and and log back in, or reboot; I've forgotten what the rules are concerning when the environment block is reloaded.
James McNellis