Called OpenCV C + + program debugging run no problem, but a run EXE on the error debug error r6010__c++

Source: Internet
Author: User

Problem Description: Recently done the project, found that called the OpenCV Library of C + + program in VS2010 up the test run completely no problem, but once the debug file under the EXE file will show debug error, specific error as shown:


Although in the call to the OPENCV library has encountered this problem, but the basic parameters are error, pointer problem, but this time when debug debugging is completely no problem, but run EXE on the wrong,

has been baffled, in the back of the run another small program when suddenly jumped out of a bug, I suddenly found, incredibly because of the path of the problem.

My project program needs to load a model file, but my path started with a relative path, which is placed directly under the engineering directory.

When I was debugging, I saw that the file was loaded, so I didn't consider the problem of file loading.

After the elimination of one by one note to find incredibly because the path is not set to absolute path, resulting in the OPENCV function in the reading file can not find the file, read in the model is empty.

Then I used the empty model to predict, so I reported the debug error errors.

Then it's no problem to change the file path to an absolute path.

Therefore, write the program later or as much as possible with the absolute path, or really wrong when even the problem is nowhere to be found.

Here's a summary of the common reasons for this error: OPENCV

1. Pointer problem, pointer out of bounds, memory leak and so on.

2. Parameter problems, many times the OPENCV function call is inaccurate, the parameters and functions do not match.

3. The path problem, if there is read the file and so on the focus of attention.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.