What this error looks like
This error occurs when running a C++ application that was built with OpenCV but Windows cannot find the opencv_world4120.dll file at runtime. The DLL exists on your machine — it just is not on the system PATH.
Add OpenCV bin directory to system PATH
- 1
Open System Environment Variables
Press Win+S → search Edit the system environment variables → click Environment Variables.
- 2
Edit the system Path variable
Under System variables (not User variables), find Path → click Edit → New.
- 3
Add the OpenCV bin path
C:\opencv\build\x64\vc16\bin# Adjust path if you extracted OpenCV to a different locationClick OK on all dialogs. Restart your application (and Visual Studio if open).
- 4
Verify the DLL is found
C:\> where opencv_world4120.dllC:\opencv\build\x64\vc16\bin\opencv_world4120.dll
Copy the DLL next to your executable
An alternative that does not require modifying PATH: copy the DLL to the same folder as your compiled .exe:
Which DLL filename do I need?
| OpenCV version | Release DLL | Debug DLL |
|---|---|---|
| 4.12.0 | opencv_world4120.dll | opencv_world4120d.dll |
| 4.10.0 | opencv_world4100.dll | opencv_world4100d.dll |
| 4.9.0 | opencv_world490.dll | opencv_world490d.dll |
The DLLs are in C:\opencv\build\x64\vc16\bin\ after extracting the Windows installer.
DLL not found questions
I added to PATH but still getting the error
LNK1107: invalid or corrupt file opencv_world4120.lib
opencv_world4120.lib for Release builds and opencv_world4120d.lib for Debug builds. Check that your project Configuration matches.