Segmentation Fault compilation on ROS Noetic OpenCV C++

Hello, here i’m using Jetson AGX Orin to try compile an PCL Processing package from ROS Noetic. Here is my Jetson Information:
Jetpack: 5.1.1
OpenCV with CUDA: 4.5.4 ON

I installed pcl library from apt, libpcl-dev and another dependecies from ros noetic (std_msgs, cv_bridge, pcl_conversion, pcl_ros, sensor_msgs, visualization_msgs, and tf). But when i compile using catkin_make, its say “undefined reference to `cv::Mat::Mat()'”. So i modified my CMakeLists.txt, i added target_link_libraries of OpenCV “${OpenCV_LIBRARIES}”. I got :

/usr/bin/ld: warning: libopencv_imgcodecs.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so, may conflict with libopencv_imgcodecs.so.4.5
/usr/bin/ld: warning: libopencv_imgproc.so.4.5, needed by /usr/local/lib/libopencv_imgcodecs.so.4.5.4, may conflict with libopencv_imgproc.so.4.2

then, when i run the package of pcl processing, the output is

PCL ACCES STARTED
Segmentation fault (core dumped)

there also a strange error in PCL include.

This program worked in amd64, is there any solution?

@ikhwanulabiyu my guess is that since pcl was installed from apt, it depends on the OpenCV that was installed in apt too. If you want OpenCV+CUDA, typically you would need to compile ROS from source against that specific build of OpenCV, like I do in this container:

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