生成开始于 22:11...
1>------ 已启动生成: 项目: YOLOv8, 配置: Debug x64 ------
1>main.obj : error LNK2019: 无法解析的外部符号 "public: bool __cdecl Yolov8PoseOnnx::ReadModel(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,bool,int,bool)" (?ReadModel@Yolov8PoseOnnx@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_NH1@Z),函数 "int __cdecl yolov8_onnx<class Yolov8PoseOnnx>(class Yolov8PoseOnnx &,class cv::Mat &,class std::basic_string<char,struct std::char_traits,class std::allocator > &)" (??$yolov8_onnx@VYolov8PoseOnnx@@@@YAHAEAVYolov8PoseOnnx@@AEAVMat@cv@@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号
1>main.obj : error LNK2019: 无法解析的外部符号 "public: bool __cdecl Yolov8PoseOnnx::OnnxDetect(class cv::Mat &,class std::vector<struct OutputParams,class std::allocator<struct OutputParams> > &)" (?OnnxDetect@Yolov8PoseOnnx@@QEAA_NAEAVMat@cv@@AEAV?$vector@UOutputParams@@V?$allocator@UOutputParams@@@std@@@std@@@Z),函数 "int __cdecl yolov8_onnx<class Yolov8PoseOnnx>(class Yolov8PoseOnnx &,class cv::Mat &,class std::basic_string<char,struct std::char_traits,class std::allocator > &)" (??$yolov8_onnx@VYolov8PoseOnnx@@@@YAHAEAVYolov8PoseOnnx@@AEAVMat@cv@@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中引用了该符号
1>D:\code\yolov8-opencv-onnxruntime-cpp\build\Debug\YOLOv8.exe : fatal error LNK1120: 2 个无法解析的外部命令
1>已完成生成项目“YOLOv8.vcxproj”的操作 - 失败。
2>------ 已跳过“生成”: 项目: ALL_BUILD, 配置: Debug x64 ------
2>没有为此解决方案配置选中要生成的项目
========== 生成: 0 成功,1 失败,1 最新,1 已跳过 ==========
========== 生成 于 22:11 完成,耗时 00.298 秒 ==========
我用的是onnxruntime-win-x64-gpu-1.20.1
链接失败,看下你的换行符有没有修改正确windows下面需要设置为CRLF,上传到github会自动切换成LF,windows下面切换一下即可。如果这个ok,请将对于的.h和.cpp文件添加到你的vs源代码中去