Microsoft Visual C++ 2017 Issue

Hello,

I have installed the OpenCV v.4.5.5 via Windows EXE. I created a folder on C: named OpenCV. Next I created a new C++ project and modified the following properties:

DEBUG x64
C/C++ → General → Added path to Additional Include Directory
Linker → General → Added path to Additional Library Directory
Linker → Input → Added Additional Dependencies value opencv_world455d.lib

RELEASE x64
C/C++ → General → Added path to Additional Include Directory
Linker → General → Added path to Additional Library Directory
Linker → Input → Added Additional Dependencies value opencv_world455.lib

When I run the code in Solution Configuration = DEBUG (i.e. pulldown) it builds OK and will display a live feed of the camera. It also displays the following error window:

Note: If I run the code in Solution Configuration = RELEASE it builds OK and will display a live feed of the camera but the error window is not displayed.

My question is how do I resolve the issues causing the error window when in DEBUG solution configuration?

For your reference below is the code in my program:

#include "opencv2\opencv.hpp"
#include "opencv2\highgui.hpp"

int main() 
{
    // Create Video Capturing Object
	cv::VideoCapture video(0);

	// Check That Video Opened
	if (!video.isOpened()) return -1;

	// For Saving The Frame
	cv::Mat frame;

	while (video.read(frame))
	{
        // Display The Frame	
		cv::imshow("Video Feed", frame);

		// For Ending The Video Early
		if (cv::waitKey(25) >= 0)
		{
			break;
		}
	}




	return 0;
}

Thanks,

Greg Maxwell