OpenCv在Visual Studio中未解决外部符号错误 [英] OpenCv unresolved external symbol error in Visual Studio
本文介绍了OpenCv在Visual Studio中未解决外部符号错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已链接到我想要使用的库,并将头文件添加到我的项目中。并且代码在红色波浪线中没有显示任何错误,但是当我尝试运行它时,它会给我以下错误:
I have linked to the libraries I want to use and added the header files to my project. And the code doesn't show any errors in red squiggle but when I try to run it, it gives me the following error:
Error 1 error LNK2001: unresolved external symbol _cvDestroyWindow C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
Error 2 error LNK2001: unresolved external symbol _cvWaitKey C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
Error 3 error LNK2001: unresolved external symbol _cvNamedWindow C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
Error 4 error LNK2001: unresolved external symbol _cvLoadImage C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
Error 5 error LNK2001: unresolved external symbol _cvShowImage C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
Error 6 error LNK2001: unresolved external symbol _cvReleaseImage C:\Users\Jos\documents\visual studio 2010\Projects\ocv\ocv\opcv.obj ocv
Error 7 error LNK1120: 6 unresolved externals C:\Users\Jos\documents\visual studio 2010\Projects\ocv\Release\ocv.exe ocv
以下是代码:
#include "highgui.h"
int main(int argc, char **argv) {
IplImage* img = cvLoadImage(argv[1],CV_LOAD_IMAGE_UNCHANGED);
cvNamedWindow("Example1",CV_WINDOW_AUTOSIZE);
cvShowImage("Example1",img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("Example1");
}
推荐答案
好吧它终于有效了。我的电脑是 64位
系统。但该项目在 Win32
平台上运行。所以我将其更改为 x64
并从 Win32
复制设置。
Ok it finally works. My PC is a 64-bit
system. But the project was running on Win32
platform. So I changed it to x64
and copied settings from Win32
.
这篇关于OpenCv在Visual Studio中未解决外部符号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文