Visual studio 2022 cannot find opencv_world4100d.dll when debugging

My program works perfectly fine in debug mode without debugger, but when I want to use a debugger this error pops up. Any ideas on how to fix it?
Picture1

your Visual Studio built your program to want that DLL. your program can’t find that DLL.

the *d.dll files are for debug builds. those DLLs may not even exist.

if you don’t have those DLLs, you need to either build your own program as a release build (so VS will make it use the non-d DLL), or figure out how to tell Visual Studio that it needs to use the non-d DLLs even for your debug build.

you are not the first to have that issue. the solution has been written about countless times. I’m sure you’ll find one of those instances.

I can build my project either in debug or release mode. The problem is I cannot use debugger as this error pops up. I’m also quite new to programming, so I’d be very grateful if you could explain it to me in more details. Thanks.