Skip to content

Commit

Permalink
fix gazebo_plugins runtime error: undefined symbol (ethz-asl#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
donghun-han committed Oct 31, 2024
1 parent 997045b commit 77cb720
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rotors_gazebo_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,18 @@ file(GLOB msgs msgs/*.proto)
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${msgs})

# Create a shared library of protobuf messages (.so extension on Linux platforms)
add_library(mav_msgs SHARED ${PROTO_SRCS})
target_link_libraries(mav_msgs ${PROTOBUF_LIBRARY} gazebo_msgs)
# add_library(mav_msgs SHARED ${PROTO_SRCS})
# target_link_libraries(mav_msgs ${PROTOBUF_LIBRARY} gazebo_msgs)

# This causes mav_msgs to be linked with every created library in this file from this
# point forward.
# NOTE: This is deprecated, should be using target_link_libraries instead
link_libraries(mav_msgs)
# link_libraries(mav_msgs)

add_library(mav_proto_msgs SHARED ${PROTO_SRCS})
target_link_libraries(mav_proto_msgs ${PROTOBUF_LIBRARY} gazebo_msgs)
list (APPEND targets_to_install mav_proto_msgs)


# ============================================== #
# ==================== CATKIN ================== #
Expand Down Expand Up @@ -246,6 +251,7 @@ if (NOT NO_ROS)
endif()
endif()

list(APPEND target_linking_LIBRARIES mav_proto_msgs)

# Including GAZEBO_MSG_INCLUDE_DIRS here allows the .cpp files generated by custom .proto files to find
# the .cpp/hpp files generated by the built-in Gazebo .proto files
Expand Down

0 comments on commit 77cb720

Please sign in to comment.