严重性 代码 说明 项目 文件 行 禁止显示状态
错误 LNK2019 无法解析的外部符号 "void cdecl drawMyContours(class std::basic_string<char,struct std::char_traits,class std::allocator >,class cv::Mat &,class std::vector<class std::vector<class cv::Point_,class std::allocator<class cv::Point_ > >,class std::allocator<class std::vector<class cv::Point_,class std::allocator<class cv::Point_ > > > >)" (?drawMyContours@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAVMat@cv@@V?$vector@V?$vector@V?$Point@H@cv@@V?$allocator@V?$Point@H@cv@@@std@@@std@@V?$allocator@V?$vector@V?$Point_@H@cv@@V?$allocator@V?$Point_@H@cv@@@std@@@std@@@2@@2@@Z),该符号在函数 main 中被引用
一般是三种可能:
一是这个函数的实现代码没有写,只写了函数申明
二是这个函数实现代码所在的文件没有加入工程
三是这个函数是某个动态库的API,但动态库对应的lib文件没有引入工程
最终导致编译器只认识函数申明,却找不到函数的具体实现,就会报LINK错误