Closed MMMMMax closed 2 years ago
you need to link opencv_videoio, such as:
set(LITE_AI_DIR ${CMAKE_SOURCE_DIR}/lite.ai.toolkit)
include_directories(${LITE_AI_DIR}/include)
link_directories(${LITE_AI_DIR}/lib})
set(TOOLKIT_LIBS lite.ai.toolkit onnxruntime)
set(OpenCV_LIBS opencv_core opencv_imgcodecs opencv_imgproc opencv_video opencv_videoio)
add_executable(lite_yolov5 examples/test_lite_yolov5.cpp)
target_link_libraries(lite_yolov5 ${TOOLKIT_LIBS} ${OpenCV_LIBS})
1: undefined reference to, std::allocator > const&, int, double, cv::Size , bool)'
cv::VideoCapture::isOpened() const' 1: undefined reference to
cv::VideoCapture::release()' 1: undefined reference tocv::VideoCapture::VideoCapture(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' 1: undefined reference to
cv::VideoWriter::release()' 1: undefined reference tocv::VideoWriter::~VideoWriter()' 1: undefined reference to
cv::VideoCapture::~VideoCapture()' 1: undefined reference to `cv::VideoWriter::VideoWriter(std::__cxx11::basic_string<char, std::chartraits