【发布时间】:2023-03-28 02:36:02
【问题描述】:
我有一个问题:error LNK2019: unresolved external symbol [...] referenced in function main
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main(int argc, char * const argv[])
{
cvNamedWindow("P2", CV_WINDOW_AUTOSIZE);
//path to image ex : c:/Users/image.jpg
CvCapture* capture = cvCreateFileCapture("path to image");
IplImage* frame;
while (1) {
frame = cvQueryFrame(capture);
if (!frame) break; cvShowImage("P2", frame); char c = cvWaitKey(0); if (c == 27) break;
}
cvReleaseCapture(&capture); cvDestroyWindow("P2");
return 0;
}
我按照教程开始我的项目,使用 OpenCV 与 Visual Studio 和 Eclipse 的配置相同,但我有同样的错误。
【问题讨论】:
-
你链接了opencv库吗?顺便说一句,使用古老的 C API 的原因是什么?
-
无法从您的图片中复制和粘贴文本,抱歉。
标签: c++ visual-studio-2010 opencv