opencv - 无法与 opencv 库链接
问题描述
我尝试将 OpenCV 与 Visual Studio 2017 一起使用并运行此示例代码给了我构建时间错误
我已经为库提供了正确的目录。我已经多次阅读有关堆栈溢出的许多教程和问题/答案,但未能成功解决问题。
#include "opencv2\opencv.hpp"
#include "opencv2\core.hpp"
#include "pch.h"
#include "opencv2\core\core.hpp"
using namespace cv;
int main(int argv, char** argc)
{
Mat test = imread("lena.jpg", IMREAD_UNCHANGED);
imshow("tst", test);
waitKey();
}
我收到以下错误
C2065 'IMREAD_UNCHANGED':undeclared identifier
C3861 'imread': identifier not found
C3861 'imshow': identifier not found
C3861 'waitkey': identifier not found
Intellisense 在我键入代码时为我提供了所有库建议,但在构建后会引发错误。
解决方案
推荐阅读
- azure-devops-rest-api - 创建服务端点是否有效?REST 方法失败,CLI 挂起
- java - 尝试将随机生成的密码存储为字符串,以便我可以将其保存到文件中(Java)
- firebase - 未定义的名称“联系人” - 有状态小部件中的 Flutter toJson 映射
- r - 包含组均值的多个条形图的分面网格
- laravel - 如何使用 Laratrust 5.2 限制选择框中的某些选项。*
- java - Java 中的 Azure 函数 - 获取远程地址 IP
- python-3.x - Sqlite3、Python 和 Tkinter 登录
- java - 令牌“eqn”上的语法错误删除此令牌
- c# - ASP NET Web 窗体无法注册用户控件 (ascx)
- r - R表函数应用所有列