错误描述
1>11_ObjectDetection.obj : error LNK2019: 无法解析的外部符号 “public: __cdecl cv::VideoCapture::VideoCapture(void)” ([email protected]@@[email protected]),该符号在函数 main 中被引用
1>11_ObjectDetection.obj : error LNK2019: 无法解析的外部符号 “public: virtual __cdecl cv::VideoCapture::~VideoCapture(void)” ([email protected]@@[email protected]),该符号在函数 main 中被引用
1>11_ObjectDetection.obj : error LNK2019: 无法解析的外部符号 “public: virtual bool __cdecl cv::VideoCapture::open(int)” ([email protected]@[email protected]@[email protected]),该符号在函数 main 中被引用
1>11_ObjectDetection.obj : error LNK2019: 无法解析的外部符号 “public: virtual bool __cdecl cv::VideoCapture::isOpened(void)const ” ([email protected]@[email protected]@UEBA_NXZ),该符号在函数 main 中被引用
1>11_ObjectDetection.obj : error LNK2019: 无法解析的外部符号 “int __cdecl cv::waitKey(int)” ([email protected]@@[email protected]),该符号在函数 main 中被引用
1>F:\DeskTop\x64\Debug\人脸识别.exe : fatal error LNK1120: 5 个无法解析的外部命令

问题分析
error LNK2019: 无法解析的外部符号
一般是源代码里用了第三方库,但工程没有添加相应的库目录

解决方法
依次选择:项目–>属性
error LNK2019: 无法解析的外部符号
然后,VC++目录–>库目录–>编辑
error LNK2019: 无法解析的外部符号
点击空白处,然后点击“…”,添加相应的路径即可
error LNK2019: 无法解析的外部符号
还没有完,然后点击链接器–>输入–>附加依赖项–>编辑,添加用到的库文件的名称
error LNK2019: 无法解析的外部符号

小结
用第三方库时,一般还会遇到 “无法打开包括文件: “opencv2/objdetect/objdetect.hpp”: No such file or directory “的错误
fatal error C1083: 无法打开包括文件: “opencv2/objdetect/objdetect.hpp”: No such file or directory

相关文章: