C语言和opencv348 未加载ntdll.pdb 错误,如何解决?

问题遇到的现象和发生背景

通过For循环显示vector中的路径的图像,不显示图像时没有报错,即代码中不加imshow和waitKey(),路径也都能正常打印出来。增加图像显示的时候就会报未加载ntdll.pdb错误,但是代码中没有新申请空间,也没有指针,所以不知道错误在哪?

问题相关代码,请勿粘贴截图

代码如下
for (size_t i = 0; i < Tool_Path.size(); i++)
{
Mat Templateimage = imread(Tool_Path[i]);
imshow("toolImg", Templateimage);
Point template_xy, template_wh;
if (from_tool_cut_template(Txt_Path[i], template_xy, template_wh) == 0)
{
cout << "模板分割坐标失败" << endl;
return 0;
}
Rect template_pos(template_xy.x, template_xy.y, template_wh.x, template_wh.y);
Mat imageGray = Templateimage(template_pos);
imshow("TemplateImg", imageGray);
printf(" %s \n", Tool_Path[i].c_str());
printf(" %s \n", Txt_Path[i].c_str());
printf(" %s \n", LearnToolFP[i].c_str());
waitKey(50);
}
Tool_Path、Txt_Path、LearnToolFP都是路径

运行结果及报错内容

img

我的解答思路和尝试过的方法
我想要达到的结果

你可以加断点调试一下,看执行到哪一行报的错。

希望这个对你有帮助:
C:\Windows\SysWOW64\ntdll.dll”。无法查找或打开 PDB 文件:
https://blog.csdn.net/liudongdong19/article/details/81322320

建议先尝试如下修改,检查是否正确打开的图片。

Mat Templateimage = imread(Tool_Path[i]);
if (Templateimage.empty()) {
  cout << "IMG read failed. path:" << Tool_Path[i] << endl;
} else {
  imshow("toolImg", Templateimage);
  。。。。。。
}

我试过了,可以正确打开图像