findContours出错 Debug Assertion Failed!Expression:_pFirstBlock == pHead vs2013

出错在这一句语句:

findContours(openimage, temptours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);


网络上找原因,很多,一遍遍检查,最后按照这个 

Under Property > C++ > code generation > Runtime libarary:
If the MSVC Runtime library is set to Multi-threaded Debug DLL (/MDd), then this is no problem (it works fine).

If the MSVC Runtime library is set to Multi-threaded Debug (/MTd), then it will throw this error, which can be fixed with the following instructions.


因为是在mfc下,又出现这个错误:

 #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. P

如下解决:

将类封装成DLL时,因为类中使用了CDC类,所以需要# include “stdafx.h”.

编译时出现错误:Building MFC application with /MD[d] (CRT dll version)requires MFC shared dll version

该错误解决方法如下:
对着你的项目点击右键,依次选择:属性->配置属性->常规,然后右边有个“项目默认值”(Project Defaults),下面有个"MFC的使用"(Use of MFC),选择“在共享 DLL 中使用 MFC”(Use MFC in a Shared DLL),就OK了~~~

猜你喜欢

转载自blog.csdn.net/changquanhao/article/details/52713705