Home > Database > Mysql Tutorial > OpenCV2.2+VC2005 error LNK2019错误解决办法

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

WBOY
Release: 2016-06-07 15:49:12
Original
2740 people have browsed it

环境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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template