How to remove memory leaks between OpenCV 1.1 and

2020-07-30 04:10发布

问题:

If you ever tried to use MFC and OpenCV together, you would know this well documented problem. As the forum shows, without linking MFC as static library, using OpenCV creates memory leaks.

A guy, however, found a way to resolve this problem by recompiling OpenCV with slightly changed code. But it was for 2.0 or later.

I would like to know if there is a similar method for OpenCV 1.0 or 1.1. Of course, there is no system.cpp in those versions. Anybody tried this?

回答1:

I don't have Visual Studio 6.0 to test on, but I had this problem on Visual Studio 9 and what I did was the following:

I went to Project Properties/Linker/Input and I added to the Delay Loaded DLLs the following DLLs:

opencv_core220d.dll;opencv_highgui220d.dll in debug

opencv_core220.dll;opencv_highgui220.dll in release

I see Visual Studio 6.0 has this option.



标签: c++ opencv mfc