gpt4 book ai didi

c++ - OpenCV 安装,未解析的外部符号

转载 作者:行者123 更新时间:2023-11-28 07:52:17 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
OpenCV: link error, can’t resolve external symbol _cvResize and _cvCvtColor
What is an undefined reference/unresolved external symbol error and how do I fix it?

我已经尝试了他们网站上所有可用的教程,以及 stackoverflow 上的解决方案,但我仍然找不到解决方案。

我已经做了什么:

1- 添加了带有标题的包含文件夹。

2- 将 lib 文件夹添加到其他 lib 目录

3- 将 opencv_core243d.lib 和 opencv_highgui243d.lib 添加到附加依赖项中。

我正在尝试编译的代码:

#include <stdio.h>
#include <cv.h>
#include <highgui.h>


int main(int argc, char* argv[])
{
if (argc < 2)
{
printf("Usage: ./opencv_hello <file.png>\n");
return -1;
}

IplImage* img = cvLoadImage(argv[1], CV_LOAD_IMAGE_UNCHANGED);
if (!img)
{
return -1;
}
cvNamedWindow("display", CV_WINDOW_AUTOSIZE);
cvShowImage("display", img );

cvWaitKey(0);

return 0;
}

链接器给出有关未解析符号的错误,例如 cvLoadImage、cvWaitKey 等。我唯一能想到的就是库,但我已经包含了它们。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com