,无法打开源文件“cv.h”和“highgui.h” [英] , Cannot open source file "cv.h" and "highgui.h"
问题描述
#pragma once zh-b $ b #include< string>
#include< cv.h>
#include< ; highgui.h>
使用命名空间std;
使用命名空间cv;
class对象
{
public:
对象( ); $
~Object(void);
对象(字符串名称);
$
int getXPos();
void setXPos(int x);
int getYPos();
void setYPos(int y);
$
标量getHSVmin();
标量getHSVmax();
$
void setHSVmin(Scalar min);
void setHSVmax(标量最大值);
字符串getType (){返回类型; }
void setType(string t){type = t; }
标量getColor(){
返回颜色;
}
void setColor(标量c){
颜色= c;
}
private:
int xPos,yPos;
字符串类型;
标量HSVmin,HSVmax;
标量颜色;
};
<我下载并执行了OPEN CV v.4.0.1。
我看到正确的opencv示例cpp示例。
但是当我制作时头文件(↑this), ,E1696:无法打开源文件< cv.h> &安培; < highgui.h>
我该如何解决?
plz help
您好,¥b $ b
感谢您在此发布。
>>但是当我制作头文件(↑this)时,E1696:无法打开源文件< ; cv.h> &安培; < highgui.h>
我该如何解决?
我已经安装了OpenCV 4.0.1并设置了环境变量,但我没有找到"cv.h"。和"highgui.h"文件在OpenCV路径中。然后我创建一个用于测试的Windows控制台应用程序项目,修改项目的属性
包括:
1。添加"XXXX \opencv \ build"\\ include""配置属性的路径> VC ++目录>包含目录。
2.添加"XXXX\opencv\build\X64 \VC14 \ lib""配置属性的路径> VC ++目录>库目录。
3.添加"opencv_world401d.lib"到配置属性>链接器>附加依赖性。
像这样:
之后:在cpp文件中,使用代码:
#include< opencv2 \ core \ core.hpp>
#include< opencv2 \highgui \highgui.hpp>似乎工作正常。
希望这些会帮助你。
祝福,
杰克
#pragma once
#include <string>
#include <cv.h>
#include <highgui.h>
using namespace std;
using namespace cv;
class Object
{
public:
Object();
~Object(void);
Object(string name);
int getXPos();
void setXPos(int x);
int getYPos();
void setYPos(int y);
Scalar getHSVmin();
Scalar getHSVmax();
void setHSVmin(Scalar min);
void setHSVmax(Scalar max);
string getType() { return type; }
void setType(string t) { type = t; }
Scalar getColor() {
return Color;
}
void setColor(Scalar c) {
Color = c;
}
private:
int xPos, yPos;
string type;
Scalar HSVmin, HSVmax;
Scalar Color;
};
i download and executed OPEN CV v. 4.0.1 .
I saw correctly opencv sample cpp example.
but when i make header file (↑ this) , , E1696: Cannot open source file <cv.h> & <highgui.h>
how can i fix it?
plz help
Hello,
Thanks for posting here.
>>but when i make header file (↑ this) , , E1696: Cannot open source file <cv.h> & <highgui.h>
how can i fix it?
I have installed the OpenCV 4.0.1 and set the Environment Variables, but I didn't find the "cv.h" and "highgui.h" file in the OpenCV path. Then I create a windows Console Application project for testing, modify the properties of the project include:
1. Add the "XXXX\opencv\build\include" path to Configuration Properties>VC++ Directories>Include Directories.
2. Add the "XXXX\opencv\build\X64\VC14\lib" path to Configuration Properties>VC++ Directories>Library Directories.
3. Add the "opencv_world401d.lib" to Configuration Properties>Linker>Additional Dependencies.
like this:
After this: On the cpp file, use the code:
#include <opencv2\core\core.hpp> #include <opencv2\highgui\highgui.hpp>it seems work fine.
Hope these will help you.
Best Wishes,
Jack
这篇关于,无法打开源文件“cv.h”和“highgui.h”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!