gpt4 book ai didi

visual-studio-2010 - LNK2019 : unresolved external symbol error in Visual Studio C++

转载 作者:太空宇宙 更新时间:2023-11-03 20:41:18 25 4
gpt4 key购买 nike

这是我在 Visual Studio C++ 中的代码

#include "stdafx.h"
#include<opencv\cv.h>
#include<opencv\highgui.h>

using namespace cv;

int main(int argc, char** argv[]) {
IplImage* img = cvLoadImage("logo.jpg");
cvNamedWindow("Test", CV_WINDOW_AUTOSIZE);
cvShowImage("Test", img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("Test");
return 0;
}

我正在使用 OpenCV 2.4.6 和 Visual Studio 2010。这是错误:

openCV_testing.obj : error LNK2019: unresolved external symbol _cvDestroyWindow
referenced in function _main
openCV_testing.obj : error LNK2019: unresolved external symbol _cvReleaseImage
referenced in function _main
openCV_testing.obj : error LNK2019: unresolved external symbol _cvWaitKey referenced in
function _main
openCV_testing.obj : error LNK2019: unresolved external symbol _cvShowImage referenced
in function _main
openCV_testing.obj : error LNK2019: unresolved external symbol _cvNamedWindow
referenced in function _main
openCV_testing.obj : error LNK2019: unresolved external symbol _cvLoadImage referenced
in function _main

请帮忙。

最佳答案

'unresolved external symbol' 表示您没有链接到所需的库。转到 Properties -> Linker -> Additional Library dependencies 并添加 OpenCV 库的路径。

关于visual-studio-2010 - LNK2019 : unresolved external symbol error in Visual Studio C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17769977/

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