简体   繁体   English

无法在 Visual Studio 2019 中打开源文件 opencv2/opencv.hpp

[英]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.

相关问题 VS Code 无法打开源文件“opencv2/opencv.hpp” - VS Code cannot open source file “opencv2/opencv.hpp” Visual Studio 2012:“opencv2/opencv.hpp”:没有这样的文件或目录 (C1083) - Visual Studio 2012: 'opencv2/opencv.hpp' : No such file or directory (C1083) 错误C1083无法在VS 2015中打开包含文件:&#39;opencv2 \\ opencv.hpp&#39; - Error C1083 Cannot open include file: 'opencv2\opencv.hpp' in VS 2015 致命错误:opencv2/opencv.hpp:没有这样的文件或目录#include“opencv2/opencv.hpp” - fatal error: opencv2/opencv.hpp: No such file or directory #include "opencv2/opencv.hpp" opencv2 / opencv.hpp:使用Eclipse IDE时没有这样的文件或目录 - opencv2/opencv.hpp: No such file or directory using Eclipse IDE VS2019:致命错误 C1083 无法打开头文件:&#39;opencv.hpp&#39; - VS2019:fatal error C1083 Cannot open header file: 'opencv.hpp' <opencv2/opencv.hpp> ,<opencv2/imgproc.hpp> ,<opencv2/highgui.hpp> 无此文件或目录 - <opencv2/opencv.hpp>, <opencv2/imgproc.hpp>, <opencv2/highgui.hpp> no such file or directory 介子和 OpenCV: fatal error: opencv2/opencv.hpp: No such file or directory - Meson and OpenCV: fatal error: opencv2/opencv.hpp: No such file or directory C++ 无法打开源文件“opencv2/tracking.hpp” - C++ cannot open source file "opencv2/tracking.hpp" 简单地包括<opencv2 opencv.hpp>导致链接错误</opencv2> - Simply including <opencv2/opencv.hpp> results in linking error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM