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

来源:互联网 发布:大数据精准营销特点 编辑:程序博客网 时间:2024/06/05 16:35

今天用calcHist()写一个直方图的基本程序 结果报错LNK2019

在网上搜索一直是说库的链接不正确 但是我已经加入所有opencv的库了

最后的最后 发现是解决方案平台应该改成x64而不是Win32 (因为我是64位系统但是VS默认是win32)但是作为小白始终不明白为什么这样就会出现链接库的错误 求大神解释


报错如下:


1>Histogram1D.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::calcHist(class cv::Mat const *,int,int const *,class cv::_InputArray const &,class cv::_OutputArray const &,int,int const *,float const * *,bool,bool)" (?calcHist@cv@@YAXPBVMat@1@HPBHABV_InputArray@1@ABV_OutputArray@1@H1PAPBM_N5@Z),该符号在函数 "public: class cv::Mat __thiscall Histogram1D::getHistogram(class cv::Mat const &)" (?getHistogram@Histogram1D@@QAE?AVMat@cv@@ABV23@@Z) 中被引用

1>Histogram1D.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray@cv@@QAE@ABVMat@1@@Z),该符号在函数 "public: class cv::Mat __thiscall Histogram1D::getHistogram(class cv::Mat const &)" (?getHistogram@Histogram1D@@QAE?AVMat@cv@@ABV23@@Z) 中被引用
1>Histogram1D.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall cv::_OutputArray::_OutputArray(class cv::Mat &)" (??0_OutputArray@cv@@QAE@AAVMat@1@@Z),该符号在函数 "public: class cv::Mat __thiscall Histogram1D::getHistogram(class cv::Mat const &)" (?getHistogram@Histogram1D@@QAE?AVMat@cv@@ABV23@@Z) 中被引用
1>Histogram1D.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall cv::Mat::copySize(class cv::Mat const &)" (?copySize@Mat@cv@@QAEXABV12@@Z),该符号在函数 "public: __thiscall cv::Mat::Mat(class cv::Mat const &)" (??0Mat@cv@@QAE@ABV01@@Z) 中被引用
1>Histogram1D.obj : error LNK2019: 无法解析的外部符号 "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd@cv@@YAHPAHH@Z),该符号在函数 "public: __thiscall cv::Mat::Mat(class cv::Mat const &)" (??0Mat@cv@@QAE@ABV01@@Z) 中被引用
1>main.obj : error LNK2001: 无法解析的外部符号 "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd@cv@@YAHPAHH@Z)
1>Histogram1D.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z),该符号在函数 "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) 中被引用
1>main.obj : error LNK2001: 无法解析的外部符号 "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z)
1>Histogram1D.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ),该符号在函数 "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ) 中被引用
1>main.obj : error LNK2001: 无法解析的外部符号 "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ)
1>main.obj : error LNK2019: 无法解析的外部符号 "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?imread@cv@@YA?AVMat@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z),该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "public: virtual __thiscall cv::Exception::~Exception(void)" (??1Exception@cv@@UAE@XZ),该符号在函数 "public: float & __thiscall cv::Mat::at<float>(int)" (??$at@M@Mat@cv@@QAEAAMH@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::error(class cv::Exception const &)" (?error@cv@@YAXABVException@1@@Z),该符号在函数 "public: float & __thiscall cv::Mat::at<float>(int)" (??$at@M@Mat@cv@@QAEAAMH@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "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),该符号在函数 "public: float & __thiscall cv::Mat::at<float>(int)" (??$at@M@Mat@cv@@QAEAAMH@Z) 中被引用
1>D:\STUDY\Coding\C++\OpenCV\practice\Chapter4\Debug\Chapter4.exe : fatal error LNK1120: 11 个无法解析的外部命令
1>
0 0
原创粉丝点击