VS2019配置opencv出现error LNK2019: 无法解析的外部符号”

在VS2019中配置OpenCV3.4.1时遇到LNK2019错误,涉及cv::Mat::copyTo等函数无法解析。问题可能是外部依赖库未正确配置。解决方法包括重新配置可用的OpenCV库,按照博客链接进行排查。
摘要由CSDN通过智能技术生成

VS2019配置opencv出现error LNK2019: 无法解析的外部符号”

其他原因分类

可以参考我放下面的连接,其解释还是很全面的
链接: link

问题概述

在我对VS2019进行opencv3.4.1的配置中出现了如下问题

1>ClusteringResultDisplay.obj : error LNK2019: 无法解析的外部符号 "public: void __cdecl cv::Mat::copyTo(class cv::debug_build_guard::_OutputArray const &)const " (?copyTo@Mat@cv@@QEBAXAEBV_OutputArray@debug_build_guard@2@@Z),该符号在函数 “class cv::Mat __cdecl SLICAP::getClusteringResult(class SLICAP::SuperPixels const &,class std::vector<int,class std::allocator >)” (?getClusteringResult@SLICAP@@YA?AVMat@cv@@AEBVSuperPixels@1@V? v e c t o r @ H V ? vector@HV? vector@HV?allocator@H@std@@@std@@@Z) 中被引用
1>SuperPixels.obj : error LNK2001: 无法解析的外部符号 "public: void __cdecl cv::Mat::copyTo(class cv::debug_build_guard::_OutputArray const &)const " (?copyTo@Mat@cv@@QEBAXAEBV_OutputArray@debug_build_guard@2@@Z)
1>main.obj : error LNK2019: 无法解析的外部符号 “void __cdecl cv::cvtColor(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@HH@Z),该符号在函数 main 中被引用
1>SuperPixelsGenerator.obj : error LNK2001: 无法解析的外部符号 “void __cdecl cv::cvtColor(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@HH@Z)
1>main.obj : error LNK2019: 无法解析的外部符号 “bool __cdecl cv::imwrite(class cv::String const &,class cv::debug_build_guard::_InputArray const &,class std::vector<int,class std::allocator > const &)” (?imwrite@cv@@YA_NAEBVString@1@AEBV_InputArray@debug_build_guard@1@AEBV? v e c t o r @ H V ? vector@HV? vector@HV?allocator@H@std@@@std@@@Z),该符号在函数 main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 “void __cdecl cv::imshow(class cv::String const &,class cv::debug_build_guard::_InputArray const &)” (?imshow@cv@@YAXAEBVString@1@AEBV_InputArray@debug_build_guard@1@@Z),该符号在函数 main 中被引用
1>D:\lito\slicAP\x64\Debug\slicAP.exe : fatal error LNK1120: 4 个无法解析的外部命令

如何进行opencv配置可以参考我的第一篇博客链接: link

然后就出现了如上问题,在排除了其他问题后,其实就在链接器中填写的输入的外部依赖包,并没有找到。

解决办法

重新配置其他的可以使用的opencv库。如果有类似的问题,可以按照我参考的博客的链接进行依次排查

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值