PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.77k stars 2.88k forks source link

visual studio 2019编译问题 #5321

Open TTgogogo opened 2 years ago

TTgogogo commented 2 years ago

我将deploy/cpp目录下的object_detector文件添加进我的工程中,出现找不到函数定义的问题,是不是需要添加额外的链接库? 错误如下:

LNK2019:无法解析的外部符号 "class std::vector<class cv::Mat,class std::allocator > cdecl PaddleDetection::PadBatch(class std::vector<class cv::Mat,class std::allocator > const &)" (?PadBatch@PaddleDetection@@YA?AV?$vector@VMat@cv@@V?$allocator@VMat@cv@@@std@@@std@@AEBV23@@Z),函数 "public: void cdecl PaddleDetection::ObjectDetector::Predict(class std::vector<class cv::Mat,class std::allocator >,double,int,int,class std::vector<struct PaddleDetection::ObjectResult,class std::allocator > ,class std::vector<int,class std::allocator > ,class std::vector<double,class std::allocator > *)" (?Predict@ObjectDetector@PaddleDetection@@QEAAXV?$vector@VMat@cv@@V?$allocator@VMat@cv@@@std@@@std@@NHHPEAV?$vector@UObjectResult@PaddleDetection@@V?$allocator@UObjectResult@PaddleDetection@@@std@@@4@PEAV?$vector@HV?$allocator@H@std@@@4@PEAV?$vector@NV?$allocator@N@std@@@4@@Z) 中引用了该符号

LNK2019: 无法解析的外部符号 "public: void cdecl YAML::detail::node_data::mark_defined(void)" (?mark_defined@node_data@detail@YAML@@QEAAXXZ),函数 "public: void cdecl YAML::detail::node_ref::mark_defined(void)" (?mark_defined@node_ref@detail@YAML@@QEAAXXZ) 中引用了该符号

LNK2001: 无法解析的外部符号 "public: static class std::basic_string<char,struct std::char_traits,class std::allocator > YAML::detail::node_data::empty_scalar" (?empty_scalar@node_data@detail@YAML@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)

heavengate commented 2 years ago

看报错信息是没有找到opencv和yaml这两个库,可以参考文档里 https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/deploy/cpp/docs/windows_vs2019_build.md#step3-安装配置opencv Step 3 安装配置opencv

TTgogogo commented 2 years ago

@heavengate 已经安装了opencv的,yaml库在哪可以下载?对应链接器依赖的yaml库是什么?

TTgogogo commented 2 years ago

@heavengate 使用yaml-cppd.lib依然报LNK2019的YAML库错误