[英]cannot open source file opencv2/opencv.hpp in visual studio 2019
I tried to run this program.我试图运行这个程序。 and I got squiggly line under the include saying我在 include 下得到了波浪线
cannot open source file opencv2/opencv.hpp无法打开源文件 opencv2/opencv.hpp
I had added all the additional dependencies and file path for the additional include directories -我已经为额外的包含目录添加了所有额外的依赖项和文件路径 -
$(C:\opencv\build\include\opencv2) $(C:\opencv\build\include\opencv2)
I am struck here and don't know how to resolve.我在这里感到震惊,不知道如何解决。 Moreover I could not find the debug folder in the saved proj file此外,我在保存的 proj 文件中找不到调试文件夹
#include <iostream>
#include "opencv2\opencv.hpp "
#include "opencv2\imgcodecs.hpp"
using namespace std;
int main()
{
Mat img;
VideoCapture cam(0);
namdeWindow("camera");
while (1)
{
cam >> img;
imshow("camera", img);
if (waitkey(1) == 27)
break;
}
cam.release();
return 0;
} }
I included the "using namespace cv;"我包括了“使用命名空间简历;” above the main().在 main() 之上。 Strangely after I restarted the PC errors are gone.奇怪的是,我重新启动后,PC 错误消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.