简体   繁体   中英

Debug Assertion Failed! when I add opencv headers in VC++ windows form application

I am trying to use OpenCV on VC++ window form application in Visual Studio 2010.

All the configuration has been done just like in console application. Now the OpenCV headers can be located and the build is successful.

But this error showed up: Debug Assertion Failed!

I haven't started any code yet, just added these headers under #pragma once:

#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp> 

Anyone knows the reason for this please help me. Thanks in advance!

Maybe you haven't set properly your compiler where to get functions and structures of OpenCv. Have a look at this link and see if it can help you solving your problem. Click me and I'll solve your problems mate!

I had a similar problem, OpenCV was built and run in Console C++ without any error. But when added to Windows form C++, it gave the error Debug Assertion Failed! when running debug (no code yet, just include the header file, and successfully built). So I looked for a solution and found one in this discussion: http://social.msdn.microsoft.com/Forums/vstudio/en-US/62db4002-4ebc-4a3a-91ec-9fc702db821e/crtisvalidheappointerpuserdata-why-is-this-code-broken-vs2008?forum=vcgeneral

Look for the answer by RobWW, it may help.

Best regards.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM