introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
1.01k stars 558 forks source link

undefined reference to `vtable for vtkSubdivisionFilter' #1107

Closed lorenzo-eng closed 9 months ago

lorenzo-eng commented 10 months ago

Hello,

I am trying to build rtabmap 0.21.3 with Open3D support on ubuntu 20.04 - ros noetic. Unfortunately, I get the following link error:

/usr/bin/ld: ../../bin/librtabmap_core.so.0.21.3: undefined reference to `vtable for vtkSubdivisionFilter'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/StereoEval/CMakeFiles/stereoEval.dir/build.make:202: bin/rtabmap-stereoEval] Error 1
make[1]: *** [CMakeFiles/Makefile2:1047: tools/StereoEval/CMakeFiles/stereoEval.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: ../../bin/librtabmap_core.so.0.21.3: undefined reference to `vtable for vtkSubdivisionFilter'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/KittiDataset/CMakeFiles/kitti_dataset.dir/build.make:202: bin/rtabmap-kitti_dataset] Error 1
make[1]: *** [CMakeFiles/Makefile2:1074: tools/KittiDataset/CMakeFiles/kitti_dataset.dir/all] Error 2
/usr/bin/ld: ../../bin/librtabmap_core.so.0.21.3: undefined reference to `vtable for vtkSubdivisionFilter'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/Camera/CMakeFiles/camera.dir/build.make:202: bin/rtabmap-camera] Error 1
make[1]: *** [CMakeFiles/Makefile2:1020: tools/Camera/CMakeFiles/camera.dir/all] Error 2
/usr/bin/ld: ../../bin/librtabmap_core.so.0.21.3: undefined reference to `vtable for vtkSubdivisionFilter'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/ConsoleApp/CMakeFiles/consoleApp.dir/build.make:202: bin/rtabmap-console] Error 1
make[1]: *** [CMakeFiles/Makefile2:939: tools/ConsoleApp/CMakeFiles/consoleApp.dir/all] Error 2
/usr/bin/ld: ../../bin/librtabmap_core.so.0.21.3: undefined reference to `vtable for vtkSubdivisionFilter'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/ExtractObject/CMakeFiles/extractObject.dir/build.make:202: bin/rtabmap-extractObject] Error 1
make[1]: *** [CMakeFiles/Makefile2:993: tools/ExtractObject/CMakeFiles/extractObject.dir/all] Error 2
/usr/bin/ld: ../../bin/librtabmap_core.so.0.21.3: undefined reference to `vtable for vtkSubdivisionFilter'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/EurocDataset/CMakeFiles/euroc_dataset.dir/build.make:203: bin/rtabmap-euroc_dataset] Error 1
make[1]: *** [CMakeFiles/Makefile2:1128: tools/EurocDataset/CMakeFiles/euroc_dataset.dir/all] Error 2
/usr/bin/ld: ../../bin/librtabmap_core.so.0.21.3: undefined reference to `vtable for vtkSubdivisionFilter'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/RgbdDataset/CMakeFiles/rgbd_dataset.dir/build.make:202: bin/rtabmap-rgbd_dataset] Error 1
make[1]: *** [CMakeFiles/Makefile2:1101: tools/RgbdDataset/CMakeFiles/rgbd_dataset.dir/all] Error 2
/usr/bin/ld: ../../bin/librtabmap_core.so.0.21.3: undefined reference to `vtable for vtkSubdivisionFilter'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/Recovery/CMakeFiles/recovery.dir/build.make:202: bin/rtabmap-recovery] Error 1
make[1]: *** [CMakeFiles/Makefile2:1155: tools/Recovery/CMakeFiles/recovery.dir/all] Error 2

build steps:

cmake -DWITH_OPEN3D=ON  ..
make

cmake output:

-- The C compiler identification is GNU 9.4.0                                                                                                                                                              
-- The CXX compiler identification is GNU 9.4.0                                                                                                                                                            
-- Detecting C compiler ABI info                                                                                                                                                                           
-- Detecting C compiler ABI info - done                                                                                                                                                                    
-- Check for working C compiler: /usr/bin/cc - skipped                                                                                                                                                     
-- Detecting C compile features                                                                                                                                                                            
-- Detecting C compile features - done                                                                                                                                                                     
-- Detecting CXX compiler ABI info                                                                                                                                                                         
-- Detecting CXX compiler ABI info - done                                                                                                                                                                  
-- Check for working CXX compiler: /usr/bin/c++ - skipped                                                                                                                                                  
-- Detecting CXX compile features                                                                                                                                                                          
-- Detecting CXX compile features - done 
....
-- Found PCL_VISUALIZATION: /usr/lib/x86_64-linux-gnu/libpcl_visualization.so                                                                                                                              
-- PCL definitions don't contain "-march=native", make sure all libraries using Eigen are also compiled without that flag to avoid some segmentation faults (with gdb referring to some Eigen functions).  
-- Found Sqlite3: /usr/include /usr/lib/x86_64-linux-gnu/libsqlite3.so                                                                                                                                     
-- Found OpenMP_C: -fopenmp (found version "4.5")                                                                                                                                                          
-- Found OpenMP_CXX: -fopenmp (found version "4.5")                                                                                                                                                        
-- Found OpenMP: TRUE (found version "4.5") found components: C CXX                                                                                                                                        
-- Found OpenMP: /usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;/usr/lib/x86_64-linux-gnu/libpthread.so                                                                                                        
-- Add PCL_OMP to definitions                                                                                                                                                                              
-- Found OpenCV: /usr/include/opencv4                                                                                                                                                                      
-- Found PCL: /usr/include/pcl-1.10;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/vtk-7.1;/usr/include/freetype2;/usr/include/x86_64-linux-gnu                                             
-- Found ZLIB: /usr/include                                                                                                                                                                                
-- VTK_RENDERING_BACKEND=OpenGL2                                                                                                                                                                           
-- Found Freenect: /usr/include                                                                                                                                                                            
-- Found OpenNI2: /usr/include/openni2                                                                                                                                                                     
-- Found DC1394: /usr/include/dc1394                                                                                                                                                                       
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0")                                                                                                                               
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so                                                                                                                                                    
-- Found g2o (targets)                                                                                                                                                                                     
-- g2o include dir: /opt/ros/noetic/include                                                                                                                                                                
-- Old g2o factory version detected without shared ptr (factory file: /opt/ros/noetic/include/g2o/core/factory.h).                                                                                         
-- GTSAM include directory:  /opt/ros/noetic/lib/cmake/GTSAM/../../../include                                                                                                                              
-- FlyCapture2_INCLUDE_DIR=FlyCapture2_INCLUDE_DIR-NOTFOUND                                                                                                                                                
-- FlyCapture2_LIBRARY=FlyCapture2_LIBRARY-NOTFOUND                                                                                                                                                        
-- Triclops_INCLUDE_DIR=Triclops_INCLUDE_DIR-NOTFOUND                                                                                                                                                      
-- Triclops_LIBRARY=Triclops_LIBRARY-NOTFOUND                                                                                                                                                              
-- FlyCaptureBridge_LIBRARY=FlyCaptureBridge_LIBRARY-NOTFOUND                                                                                                                                              
-- Found Threads: TRUE                                                                                                                                                                                     
-- Found Boost: /usr/include (found version "1.71.0") found components: thread filesystem system program_options date_time chrono atomic                                                                   
-- Found libpointmatcher: /opt/ros/noetic/include;/usr/include/eigen3                                                                                                                                      
-- Found Boost: /usr/include (found version "1.71.0") found components: thread filesystem system program_options date_time chrono timer serialization atomic                                               
CMake Deprecation Warning at /usr/local/lib/cmake/Open3D/Open3DConfig.cmake:18 (cmake_policy):                                                                                                             
  The OLD behavior for policy CMP0072 will be removed from a future version                                                                                                                                
  of CMake.                                                                                                                                                                                                

  The cmake-policies(7) manual explains that the OLD behaviors of all                                                                                                                                      
  policies are deprecated and that a policy should be set to OLD only under                                                                                                                                
  specific short-term circumstances.  Projects should be ported to the NEW                                                                                                                                 
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:563 (find_package)

-- Found Open3D:                                                                                                                                                                                           
-- Found RealSense2:                                                                                                                                                                                       
-- Found octomap 1.9.8: /opt/ros/noetic/include                                                                                                                                                            
-- Found grid_map_core 1.6.4: /opt/ros/noetic/include;/usr/include/eigen3                                                                                                                                  
-- Architecture: x86_64                                                                                                                                                                                    
-- Performing Test COMPILER_SUPPORTS_CXX14                                                                                                                                                                 
-- Performing Test COMPILER_SUPPORTS_CXX14 - Success                                                                                                                                                       
-- Found Pthreads                                                                                                                                                                                          
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY                                                                                                                                                          
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success                                                                                                                                                
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY                                                                                                                                                   
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success                                                                                                                                         
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR                                                                                                                                                            
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success                                                                                                                                                  
-- --------------------------------------------                                                                                                                                                            
-- Info :                                                                                                                                                                                                  
--   RTAB-Map Version =     0.21.3                                                                                                                                                                         
--   CMAKE_VERSION =        3.28.1                                                                                                                                                                         
--   CMAKE_INSTALL_PREFIX = /usr/local                                                                                                                                                                     
--   CMAKE_BUILD_TYPE =     Release                                                                                                                                                                        
--   CMAKE_INSTALL_LIBDIR = lib                                                                                                                                                                            
--   BUILD_APP =            ON                                                                                                                                                                             
--   BUILD_TOOLS =          ON                                                                                                                                                                             
--   BUILD_EXAMPLES =       ON                                                                                                                                                                             
--   BUILD_SHARED_LIBS =    ON                                                                                                                                                                             
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -fopenmp -std=c++14                                                                                                                                            
--   FLANN_KDTREE_MEM_OPT = OFF                                                                                                                                                                            
--   PCL_DEFINITIONS = -DDISABLE_OPENNI2;-DDISABLE_PCAP;-DDISABLE_PNG;-DDISABLE_LIBUSB_1_0                                                                                                                 
--   PCL_VERSION = 1.10.0                                                                                                                                                                                  
--                                                                                                                                                                                                         
-- Optional dependencies ('*' affects some default parameters) :                                                                                                                                           
--  *With OpenCV 4.2.0 xfeatures2d = NO, nonfree = NO (License: BSD)                                                                                                                                       
--   With Qt 5.12.8            = YES (License: Open Source or Commercial)                                                                                                                                  
--   With VTK 7.1              = YES (License: BSD)                                                                                                                                                        
--   With external SQLite3     = YES (License: Public Domain)                                                                                                                                              
--   With ORB OcTree           = YES (License: GPLv3)                                                                                                                                                      
--   With SupertPoint          = NO (WITH_TORCH=OFF)                                                                                                                                                       
--   With Python3              = NO (WITH_PYTHON=OFF)                                                                                                                                                      
--   With Madgwick             = YES (License: GPL)                                                                                                                                                        
--   With FastCV               = NO (FastCV not found)                                                                                                                                                     
--   With PDAL                 = NO (PDAL not found)                                                                                                                                                       
--                                                                                                                                                                                                         
--  Solvers:
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])                                                                                          [609/1916]
--  *With g2o 1.0.0            = YES (License: BSD)                                                                                                                                                        
--  *With GTSAM 4.2.0          = YES (License: BSD)                                                                                                                                                        
--  *With Ceres                = NO (WITH_CERES=OFF)                                                                                                                                                       
--   With MRPT                 = NO (MRPT not found)                                                                                                                                                       
--   With VERTIGO              = YES (License: GPLv3)                                                                                                                                                      
--   With cvsba                = NO (WITH_CVSBA=OFF)                                                                                                                                                       
--  *With libpointmatcher 1.3.1 = YES (License: BSD)                                                                                                                                                       
--   With CCCoreLib            = NO (WITH_CCCORELIB=OFF)                                                                                                                                                   
--   With Open3D               = YES (License: MIT)                                                                                                                                                        
--   With OpenGV               = NO (OpenGV not found)                                                                                                                                                     
--                                                                                                                                                                                                         
--  Reconstruction Approaches:                                                                                                                                                                             
--   With OctoMap 1.9.8        = YES (License: BSD)                                                                                                                                                        
--   With GridMap 1.6.4        = YES (License: BSD)                                                                                                                                                        
--   With CPUTSDF              = NO (WITH_CPUTSDF=OFF)                                                                                                                                                     
--   With OpenChisel           = NO (WITH_OPENCHISEL=OFF)                                                                                                                                                  
--   With AliceVision          = NO (WITH_ALICE_VISION=OFF)                                                                                                                                                
--                                                                                                                                                                                                         
--  Camera Drivers:                                                                                                                                                                                        
--   With Freenect             = YES (License: Apache v2 and/or GPLv2)                                                                                                                                     
--   With OpenNI2              = YES (License: Apache v2)                                                                                                                                                  
--   With Freenect2            = NO (libfreenect2 not found)                                                                                                                                               
--   With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found)                                                                                                                                   
--   With Kinect for Azure     = NO (Kinect for Azure SDK not found)                                                                                                                                       
--   With dc1394               = YES (License: LGPL)                                                                                                                                                       
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)                                                                                                                                             
--   With ZED                  = NO (ZED sdk and/or cuda not found)                                                                                                                                        
--   With ZEDOC                = NO (ZED Open Capture not found)                                                                                                                                           
--   With RealSense            = NO (librealsense not found)                                                                                                                                               
--   With RealSense2 2.50.0    = YES (License: Apache-2)                                                                                                                                                   
--   With MyntEyeS             = NO (mynteye s sdk not found)                                                                                                                                              
--   With DepthAI              = NO (WITH_DEPTHAI=OFF)                                                                                                                                                     
--                                                                                                                                                                                                         
--  Odometry Approaches:                                                                                                                                                                                   
--   With loam_velodyne        = NO (WITH_LOAM=OFF)                                                                                                                                                        
--   With floam                = NO (WITH_FLOAM=OFF)                                                                                                                                                       
--   With libfovis             = NO (WITH_FOVIS=OFF)                                                                                                                                                       
--   With libviso2             = NO (WITH_VISO2=OFF)                                                                                                                                                       
--   With dvo_core             = NO (WITH_DVO=OFF) 
--   With okvis                = NO (WITH_OKVIS=OFF)
--   With msckf_vio            = NO (WITH_MSCKF_VIO=OFF)
--   With VINS-Fusion          = NO (WITH_VINS=OFF)
--   With OpenVINS             = NO (WITH_OPENVINS=OFF)
--   With ORB_SLAM             = NO (WITH_ORB_SLAM=OFF)
$ ldd bin/librtabmap_core.so.0.21.3 | grep vtk
        libvtkCommonCore-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkCommonCore-7.1.so.7.1p (0x00007fa902c2a000)
        libvtkFiltersModeling-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkFiltersModeling-7.1.so.7.1p (0x00007fa8fffce000)
        libvtkFiltersCore-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkFiltersCore-7.1.so.7.1p (0x00007fa8ffa94000)
        libvtkCommonExecutionModel-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkCommonExecutionModel-7.1.so.7.1p (0x00007fa8ff9c9000)
        libvtkCommonDataModel-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkCommonDataModel-7.1.so.7.1p (0x00007fa8ff5f1000)
        libvtkIOGeometry-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkIOGeometry-7.1.so.7.1p (0x00007fa8fd3f0000)
        libvtkIOLegacy-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkIOLegacy-7.1.so.7.1p (0x00007fa8fd326000)
        libvtkIOPLY-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkIOPLY-7.1.so.7.1p (0x00007fa8fd307000)
        libvtkIOCore-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkIOCore-7.1.so.7.1p (0x00007fa8fd1bb000)
        libvtkImagingCore-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkImagingCore-7.1.so.7.1p (0x00007fa8fcfb6000)
        libvtkIOImage-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkIOImage-7.1.so.7.1p (0x00007fa8fcdeb000)
        libvtksys-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtksys-7.1.so.7.1p (0x00007fa8fcd9d000)
        libvtkFiltersSources-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkFiltersSources-7.1.so.7.1p (0x00007fa8f7e33000)
        libvtkFiltersGeneral-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkFiltersGeneral-7.1.so.7.1p (0x00007fa8f7ae9000)
        libvtkCommonMisc-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkCommonMisc-7.1.so.7.1p (0x00007fa8f7acb000)
        libvtkCommonTransforms-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkCommonTransforms-7.1.so.7.1p (0x00007fa8f7a97000)
        libvtkCommonMath-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkCommonMath-7.1.so.7.1p (0x00007fa8f7a70000)
        libvtkCommonSystem-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkCommonSystem-7.1.so.7.1p (0x00007fa8f7a56000)
        libvtkDICOMParser-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkDICOMParser-7.1.so.7.1p (0x00007fa8f4c3e000)
        libvtkmetaio-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkmetaio-7.1.so.7.1p (0x00007fa8f4b9f000)
        libvtkCommonComputationalGeometry-7.1.so.7.1p => /lib/x86_64-linux-gnu/libvtkCommonComputationalGeometry-7.1.so.7.1p (0x00007fa8f3924000)

Thank you for any suggestion

matlabbe commented 10 months ago

Can you cleanup the build directory and retry? I cannot reproduce the issue.

lorenzo-eng commented 9 months ago

sorry there was a mess with my build container I haven't fully understood, yet. Simply cleaning up the build directory was not enough, but starting a new container and installing again dependencies has worked. Thank you for your support