错误:Visual Studio中没有为opencv_world310.dll加载符号

Error: No symbols loaded for opencv_world310.dll in Visual Studio

本文关键字:opencv world310 dll 符号 加载 Visual Studio 错误      更新时间:2023-10-16

我正在Visual Studio 2015中使用OpenCV-3.1.0编写程序。大多数操作都很好,但是,我遇到了访问违规错误。我调试了这个项目,在执行faceClassifier.load("haarcascade_foronalface_alt.xml")后,Locals窗口显示"Information not available,no symbol loaded for opencv_world310.dll"

#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;
    }
}

您没有使用OpenCV调试库。普通库不包含调试信息。

调试库在.dll.lib 之前有一个d

尝试

opencv_world310d.dll