1、linux下出现错误:
libyolov8.so: undefined reference to `sample::splitToStringVec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char)'
collect2: error: ld returned 1 exit status
CMakeFiles/app_yolov8.dir/build.make:147: recipe for target 'app_yolov8' failed
make[2]: *** [app_yolov8] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/app_yolov8.dir/all' failed
make[1]: *** [CMakeFiles/app_yolov8.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
原因:仓库默认tensorrt8.4.2.4,你使用了更新版本,如:tensorrt8.6.1.6
解决:修改cmakelist就行,sample::splitToStringVec函数在文件:/samples/common/sampleUtils.cpp,所以这里直接在原来cmakelists中增加这个文件就行,如下图:
重新make编译之后,通过: