【问题标题】:opencv/visual studio : error LNK2019: unresolved external symbolopencv/visual studio:错误 LNK2019:未解析的外部符号
【发布时间】: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;
}

enter image description here

我按照教程开始我的项目,使用 OpenCV 与 Visual Studio 和 Eclipse 的配置相同,但我有同样的错误。

【问题讨论】:

标签: c++ visual-studio-2010 opencv


【解决方案1】:

您可能缺少指定输入库(项目属性/链接/输入)。 您没有指定您使用的是哪个版本的 opencv。如果您像我一样使用 openCV 3.1,则 lib 是 opencv_world310d.lib 用于调试,opencv_world310.lib 用于发布。请同时检查您的应用程序的位数。预建库适用于 64 位。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-15
    • 2019-05-27
    • 2012-10-31
    相关资源
    最近更新 更多