error LNK2019: unresolved external symbol 问题

原创 2012年05月12日 11:02:40
main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CvSVM::~CvSVM(void)" (??1CvSVM@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey@cv@@YAHH@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "bool __cdecl cv::imwrite(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &,class std::vector<int,class std::allocator<int> > const &)" (?imwrite@cv@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@1@ABV?$vector@HV?$allocator@H@std@@@3@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray@cv@@QAE@ABVMat@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual float const * __thiscall CvSVM::get_support_vector(int)const " (?get_support_vector@CvSVM@@UBEPBMH@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual int __thiscall CvSVM::get_support_vector_count(void)const " (?get_support_vector_count@CvSVM@@UBEHXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl cv::circle(class cv::Mat &,class cv::Point_<int>,int,class cv::Scalar_<double> const &,int,int,int)" (?circle@cv@@YAXAAVMat@1@V?$Point_@H@1@HABV?$Scalar_@N@1@HHH@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual float __thiscall CvSVM::predict(class cv::Mat const &,bool)const " (?predict@CvSVM@@UBEMABVMat@cv@@_N@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual bool __thiscall CvSVM::train(class cv::Mat const &,class cv::Mat const &,class cv::Mat const &,class cv::Mat const &,struct CvSVMParams)" (?train@CvSVM@@UAE_NABVMat@cv@@000UCvSVMParams@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall CvSVM::CvSVM(void)" (??0CvSVM@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall CvSVMParams::CvSVMParams(void)" (??0CvSVMParams@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: static class cv::MatExpr __cdecl cv::Mat::zeros(int,int,int)" (?zeros@Mat@cv@@SA?AVMatExpr@2@HHH@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::copySize(class cv::Mat const &)" (?copySize@Mat@cv@@QAEXABV12@@Z) referenced in function "public: __thiscall cv::Mat::Mat(class cv::Mat const &)" (??0Mat@cv@@QAE@ABV01@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::Exception::~Exception(void)" (??1Exception@cv@@UAE@XZ) referenced in function "public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" (??0Mat@cv@@QAE@HHHPAXI@Z)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl cv::error(class cv::Exception const &)" (?error@cv@@YAXABVException@1@@Z) referenced in function "public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" (??0Mat@cv@@QAE@HHHPAXI@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::Exception::Exception(int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (??0Exception@cv@@QAE@HABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00H@Z) referenced in function "public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" (??0Mat@cv@@QAE@HHHPAXI@Z)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::create(int,int const *,int)" (?create@Mat@cv@@QAEXHPBHH@Z) referenced in function "public: void __thiscall cv::Mat::create(int,int,int)" (?create@Mat@cv@@QAEXHHH@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::MatConstIterator::seek(int,bool)" (?seek@MatConstIterator@cv@@QAEXH_N@Z) referenced in function "public: class cv::MatConstIterator & __thiscall cv::MatConstIterator::operator++(void)" (??EMatConstIterator@cv@@QAEAAV01@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::convertTo(class cv::_OutputArray const &,int,double,double)const " (?convertTo@Mat@cv@@QBEXABV_OutputArray@2@HNN@Z) referenced in function "public: class cv::Mat_<float> & __thiscall cv::Mat_<float>::operator=(class cv::Mat const &)" (??4?$Mat_@M@cv@@QAEAAV01@ABVMat@1@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_OutputArray::_OutputArray(class cv::Mat &)" (??0_OutputArray@cv@@QAE@AAVMat@1@@Z) referenced in function "public: class cv::Mat_<float> & __thiscall cv::Mat_<float>::operator=(class cv::Mat const &)" (??4?$Mat_@M@cv@@QAEAAV01@ABVMat@1@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: class cv::Mat __thiscall cv::Mat::reshape(int,int,int const *)const " (?reshape@Mat@cv@@QBE?AV12@HHPBH@Z) referenced in function "public: class cv::Mat_<float> & __thiscall cv::Mat_<float>::operator=(class cv::Mat const &)" (??4?$Mat_@M@cv@@QAEAAV01@ABVMat@1@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::MatConstIterator::seek(int const *,bool)" (?seek@MatConstIterator@cv@@QAEXPBH_N@Z) referenced in function "public: __thiscall cv::MatConstIterator::MatConstIterator(class cv::Mat const *)" (??0MatConstIterator@cv@@QAE@PBVMat@1@@Z)
1>F:\MyProject\SVM\OpenCV\SVMexample\Debug\SVMexample.exe : fatal error LNK1120: 25 unresolved externals

原来在在Link里没有把以下的库包含进去。

opencv_core220d.lib
opencv_highgui220d.lib
opencv_video220d.lib
opencv_ml220d.lib
opencv_legacy220d.lib
opencv_imgproc220d.lib

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chenbang110/article/details/7559851

错误 1 error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartu

当出现这种错误时,你首先要做得是检查代码拼写错误 ,特别是字母拼写顺序错误、{ }不匹配,有很大概率是这种低级错误。接下来才考虑其它问题:   产生这个问题可能的原因 1, 你用vc建了一个控制台程序...
  • neuqbingoye
  • neuqbingoye
  • 2012-02-27 20:07:44
  • 22295

关于error LNK2019::Unresolved External Symbol * Referenced In Function..解决办法

Error LNK2019:Unresolved External Symbol *** Referenced In Function ***的解决方案   当头文件中声明了一个函数,但是在相应的源文...
  • baidu_24736703
  • baidu_24736703
  • 2016-05-16 20:12:41
  • 6836

使用protobuf()

Protobuf的简介请看这里:http://blog.csdn.net/program_think/archive/2009/05/31/4229773.aspx 哪我们来讲一下该如何使用 1,首先...
  • ganpengjin1
  • ganpengjin1
  • 2015-10-21 01:19:45
  • 1342

无法解析的外部符号 "__int64 google::protobuf::internal::empty_string_once_init_"

在搭建caffe的过程中,有可能会出现下面三个错误: error LNK2001: 无法解析的外部符号 "__int64 google::protobuf::internal::empty_stri...
  • Quincuntial
  • Quincuntial
  • 2016-01-27 12:00:52
  • 6676

error LNK2019: 无法解析的外部符号 "void __cdecl cv::calcHist

今天用calcHist()写一个直方图的基本程序 结果报错LNK2019 在网上搜索一直是说库的链接不正确 但是我已经加入所有opencv的库了 最后的最后 发现是解决方案平台应该改成x64而不是Wi...
  • sinat_29547669
  • sinat_29547669
  • 2015-07-04 20:43:00
  • 17320

opencv solvePnP

我写这篇文章的原因是使用opencv里的solvePnP时遇到一些问题,我打算利用这个函数来根据一些已知点对求相机在空间坐标系中的旋转及偏移。相关应用如:求一个物体在相机坐标系中的刚性变换(旋转、偏移...
  • DannieGo
  • DannieGo
  • 2015-10-30 19:39:05
  • 13344

C++链接器工具错误:LNK2001, LNK2019

 这是归属于链接器工具错误 这一类。无法解析的外部符号“symbol”代码引用了链接器无法在库和对象文件中找到的内容(如函数、变量或标签)。可能的原因 代码请求的内容不存在(例如,符号拼写错误...
  • roger_77
  • roger_77
  • 2006-09-21 10:56:00
  • 32530

error LNK2019: 无法解析的外部符号

error LNK2019,这类问题一般是因为链接lib库文件时的问题。 所以只要正确的进行lib库文件的链接,这类问题就会得到解决。 lib库文件包含了DLL中函数的想关信息,因此我们只需要...
  • Acheld
  • Acheld
  • 2016-11-28 23:28:32
  • 2574

VS2010:error LNK2019 :无法解析的外部符号

新的解决方案:error LNK2019
  • renguoqing1001
  • renguoqing1001
  • 2016-10-18 13:59:49
  • 9791

关于vs中出现lnk2019和lnk1120错误

今天配置vs2015+direcx时按照网上说的一步步的设置但是最后出现了如下错误lnk2019和lnk1120 然后上网搜索了找到答案,别人说是一开始新建项目时错了,应该新建win32appl...
  • dengyueyao
  • dengyueyao
  • 2017-04-22 21:32:53
  • 859
收藏助手
不良信息举报
您举报文章:error LNK2019: unresolved external symbol 问题
举报原因:
原因补充:

(最多只允许输入30个字)