LNK2019:Visual Studio C ++中无法解决的外部符号错误 [英] LNK2019: unresolved external symbol error in Visual Studio C++

查看:226
本文介绍了LNK2019:Visual Studio C ++中无法解决的外部符号错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

This is my code in 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 Studio2010.这是错误消息:

I am using OpenCV 2.4.6 and Visual Studio 2010. This is the error:

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库的路径.

'unresolved external symbol' means that you're not linking with required library. Go to Properties -> Linker -> Additional Library dependencies and add path to OpenCV libs.

这篇关于LNK2019:Visual Studio C ++中无法解决的外部符号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆