Skip to content

Commit 9401c17

Browse files
authored
Fix compilation for jazzy (#113)
1 parent a63b8fa commit 9401c17

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

graph_based_slam/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ endif()
1919
SET(CMAKE_CXX_FLAGS "-O2 -g ${CMAKE_CXX_FLAGS}")
2020
add_compile_definitions(G2O_USE_VENDORED_CERES)
2121

22+
# Find missing symbols during link time
23+
add_link_options(-Wl,--no-undefined)
24+
2225
# find dependencies
2326
find_package(ament_cmake REQUIRED)
2427
find_package(rclcpp REQUIRED)
@@ -75,16 +78,18 @@ ament_target_dependencies(graph_based_slam_component
7578
ndt_omp_ros2
7679
)
7780

81+
target_link_libraries(graph_based_slam_component
82+
g2o::core
83+
g2o::types_slam3d
84+
g2o::solver_eigen
85+
)
86+
7887
add_executable(graph_based_slam_node
7988
src/graph_based_slam_node.cpp
8089
)
8190

8291
target_link_libraries(graph_based_slam_node
83-
graph_based_slam_component
84-
${PCL_LIBRARIES}
85-
g2o::core
86-
g2o::types_slam3d
87-
g2o::solver_eigen
92+
graph_based_slam_component
8893
)
8994

9095
ament_target_dependencies(graph_based_slam_node

0 commit comments

Comments
 (0)