本文介绍了如何删除OpenCV 1.1和MFC 6.0之间的内存泄漏,而不将MFC链接为静态库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 如果您尝试一起使用MFC和OpenCV,您会知道这个井记录问题。如论坛所示,没有链接MFC作为静态库,使用OpenCV会创建内存泄漏。 然而,一个人发现通过重新编译OpenCV和稍微修改的代码来解决这个问题。但是它是2.0或更高版本。 我想知道OpenCV 1.0或1.1是否有类似的方法。当然,在这些版本中没有system.cpp。任何人试过这个?解决方案我没有Visual Studio 6.0测试,但我有这个问题在Visual Studio 9我做的是以下: 我去了项目属性/链接器/输入 延迟加载的DLL 以下DLL: opencv_core220d.dll; opencv_highgui220d.dll in debug opencv_core220.dll; opencv_highgui220.dll $ b 我看到 Visual Studio 6.0有此选项。 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? 解决方案 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 debugopencv_core220.dll;opencv_highgui220.dll in releaseI see Visual Studio 6.0 has this option. 这篇关于如何删除OpenCV 1.1和MFC 6.0之间的内存泄漏,而不将MFC链接为静态库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 08:41