I have purchased the Oak-D cam a few weeks ago and with Python, everything goes well. The problem is when I try to run the camera in C++ using Code::Blocks the script builds correctly but when I use the function cv::imshow("name", InCam->getCvFrame()); I got the error "Failed to allocate XXXXXXX bytes in function 'OutOfMemoryError' "

The codes I tried to run are Mono Preview and RGB Preview and both failed. When I use OpenCV out of this it works well so the problem is not in OpenCV but I don't find any solution to this problem. Is this a common problem?
I have purchased the Oak-D cam a few weeks ago and with Python, everything goes well. The problem is when I try to run the camera in C++ using Code::Blocks the script builds correctly but when I use the function cv::imshow("name", InCam->getCvFrame()); I got the error "Failed to allocate XXXXXXX bytes in function 'OutOfMemoryError' "
The codes I tried to run are Mono Preview and RGB Preview and both failed. When I use OpenCV out of this it works well so the problem is not in OpenCV but I don't find any solution to this problem. Is this a common problem?