首頁  >  文章  >  資料庫  >  OpenCV2.2+VC2005 error LNK2019错误解决办法

OpenCV2.2+VC2005 error LNK2019错误解决办法

WBOY
WBOY原創
2016-06-07 15:49:122678瀏覽

环境OpenCV2.2+vs2005+XP 按照官网提供的安装配置方法,对VS2005的环境进行了设置,但是调试程序时,编译通过却出现链接错误,如下: 1opencvhello.obj : error LNK2019: 无法解析的外部符号 "int __cdecl cv::waitKey(int)" ( ?waitKey@cv@@YAHH@Z ),该符

环境OpenCV2.2+vs2005+XP

按照官网提供的安装配置方法,对VS2005的环境进行了设置,但是调试程序时,编译通过却出现链接错误,如下:

1>opencvhello.obj : error LNK2019: 无法解析的外部符号 "int __cdecl cv::waitKey(int)" (?waitKey@cv@@YAHH@Z),该符号在函数 _wmain 中被引用
1>opencvhello.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::imshow(class std::basic_string,class std::allocator > const &,class cv::Mat const &)" (
?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVMat@1@@Z),该符号在函数 _wmain 中被引用
1>opencvhello.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::namedWindow(class std::basic_string,class std::allocator > const &,int)" (
?namedWindow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z),该符号在函数 _wmain 中被引用
1>opencvhello.obj : error LNK2019: 无法解析的外部符号 "class cv::Mat __cdecl cv::imread(class std::basic_string,class std::allocator > const &,int)" (
?imread@cv@@YA?AVMat@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z),该符号在函数 _wmain 中被引用
1>opencvhello.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::fastFree(void *)" (
?fastFree@cv@@YAXPAX@Z),该符号在函数 "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) 中被引用
1>opencvhello.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>D:/test/opencv/opencvhello/Debug/opencvhello.exe : fatal error LNK1120: 6 个无法解析的外部命令

 

错误原因:库文件设置不正确

解决办法:项目->属性->连接器->输入->附加依赖项,添加程序所依赖的库文件,本程序用到opencv_core220d.lib 和opencv_highgui220d.lib

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn