无法解析的外部符号的一般解决思路可以参考这篇文章。这里主要针对cv::imwrite
这个函数,报错内容如下图所示:
严重性 代码 说明 项目 文件 行 禁止显示状态 错误 LNK2019 无法解析的外部符号 "bool __cdecl cv::imwrite(class cv::String const &,class cv::debug_build_guard::_InputArray const &,class std::vector<int,class std::allocator<int> > const &)" (?imwrite@cv@@YA_NAEBVString@1@AEBV_InputArray@debug_build_guard@1@AEBV?$vector@HV?$allocator@H@std@@@std@@@Z),该符号在函数 "public: float __cdecl ScaleProperties::griddingAndAreaCalculation(class std::vector<struct SurfaceSegment,class std::allocator<struct SurfaceSegment> >)" (?griddingAndAreaCalculation@ScaleProperties@@QEAAMV?$vector@USurfaceSegment@@V?$allocator@USurfaceSegment@@@std@@@std@@@Z) 中被引用
解决办法是,在项目-属性-链接器-附加依赖项里,加上opencv_world347d.lib
。其中347
依据你实际使用的opencv版本来定,最后的d
是debug版本,如果是release版本,就不需要加d
。
cv::imwrite无法解析的外部符号解决办法
最新推荐文章于 2024-05-30 20:16:55 发布