Build ROS on Jetson AGX Xavier, and undefined reference to 'cv::Mat::Mat()' appears usb_cam compilation

My jetson installs the latest 35.1, the system has opencv installed by default, but the compilation usb_cam package error message undefined reference to ‘cv::Mat::Mat()’, because there are two versions of opencv, so there is a conflict? What should I do?

➜  ~ pkg-config --modversion opencv4

The default version of OpenCV in Jetson is 4.5.4, but ROS relies on OpenCV 4.2, do I want to remove OpenCV?

Hi @DreamLan, my guess is either point the usb_cam package to the version of OpenCV that ROS is using (I’m not exactly sure how to do that, but I think uninstalling OpenCV 4.2 will also remove ROS packages that you have installed)

Alternatively, you could use the ROS/ROS2 containers from that were built against ROS (from source) and OpenCV 4.5 (with CUDA) so there shouldn’t be that OpenCV conflict/mismatch.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.