快捷搜索: 王者荣耀 脱发

cv::imwrite无法解析的外部符号解决办法

  无法解析的外部符号的一般解决思路可以参考。这里主要针对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。

经验分享 程序员 微信小程序 职场和发展