如何解决imgproc.hpp 和core.hpp 出错?

Tha*_*988 5 c++ opencv

我使用 c++ 程序使用 opencv 2.1 进行图像处理。该程序具有以下包含文件:

#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <math.h>
#include <string.h>
Run Code Online (Sandbox Code Playgroud)

但在调试程序后,我收到错误消息:

致命错误 C1083:无法打开包含文件:'opencv2/core/core.hpp':没有这样的文件或目录。

这是相同imgproc.hpphighgui.hpp后,我改变了 #include "opencv2/highgui/highgui.hpp"#include <highgui.h>和错误解决。

但是我找不到imgproc.hpphighgui.hpp的解决方案,并且opencv 文件夹中没有名为imgproc.hpphighgui.hpp的文件。

我该如何解决这个错误?

keb*_*ebs 1

从路径分隔符来看,我假设您正在使用 *nix 操作系统。因此,以下 shell 命令应该可以帮助您找到头文件的正确位置:

locate highgui.h
locate highgui.hpp
Run Code Online (Sandbox Code Playgroud)