YOLOv5-LibTorch
YOLOv5-LibTorch copied to clipboard
Opencv Error when running make
When i run make, it returns a linking error.
/usr/bin/ld: CMakeFiles/YOLOv5LibTorch.dir/src/YOLOv5LibTorch.cpp.o: in function main': YOLOv5LibTorch.cpp:(.text.startup+0xed7): undefined reference to
cv::putText(cv::InputOutputArray const&, std::string const&, cv::Pointcv::imshow(std::string const&, cv::_InputArray const&)' /usr/bin/ld: YOLOv5LibTorch.cpp:(.text.startup+0x1621): undefined reference to
cv::format(char const*, ...)'
/usr/bin/ld: YOLOv5LibTorch.cpp:(.text.startup+0x16f6): undefined reference to `cv::putText(cv::InputOutputArray const&, std::string const&, cv::Point
If you haven't figured it out since then, there might be some solutions that might help you. I have encountered similar problems
- Don't download that libtorch that is recomended in Readme. That was the first thing that was not working for me.
- Instead, download it from PyTorch website, but if you are looking compatability with OpenCV on C++, use this one with cxx11 ABI.
- Don't forget to erase the other one.
- Second thing, check your OpenCV version if it meets your expectations, I included several times opencv instead of e.g. opencv4, but this might not be the case.
@lotricekCZ thanks! I changed the original libtorch with that you provided.Problem solved.