Error: No symbols loaded for opencv_world310.dll i

2020-04-18 07:02发布

问题:

I'm writing program using OpenCV-3.1.0 in Visual Studio 2015. Most of the operations work fine, however, I get an Access Violation error. I have debugged the project, after faceClassifier.load("haarcascade_frontalface_alt.xml") is executed, the Locals windows displays "Information not available, no symbols loaded for opencv_world310.dll". Here's the code:

#include "opencv2/objdetect.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;

void detectAndDisplay(Mat);

int main()
{
    Mat img = imread("faces.jpg");
    detectAndDisplay(img);
    return 0;
}


void detectAndDisplay(Mat img)
{
    CascadeClassifier faceClassifier;
    faceClassifier.load("haarcascade_frontalface_alt.xml");
    vector<Rect> faces;
    Mat gray;
    cvtColor(img, gray, CV_BGR2GRAY);
    faceClassifier.detectMultiScale(gray, faces,1.1,3,0);

    for (int i = 0; i < faces.size(); i++)
    {
        Point center(faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5);
        ellipse(img, center, Size(faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar(255, 0, 255), 4, 8, 0);
    }

    namedWindow("Faces", 1);

    while (true)
    {
        imshow("Faces", img);
        if (waitKey(30) >= 0) break;
    }
}

回答1:

You are not using the OpenCV debug libraries. The normal libraries do not contain debug information.

The debug libraries have a d before .dll or .lib

Try

opencv_world310d.dll