File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
multithread_publisher_subscriber Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ find_package(ament_cmake REQUIRED)
66find_package (rcl REQUIRED )
77find_package (rclc REQUIRED )
88find_package (example_interfaces REQUIRED )
9+ find_package (Threads REQUIRED )
910
1011add_executable (${PROJECT_NAME} main.c )
12+ target_link_libraries (${PROJECT_NAME} Threads::Threads )
1113
1214ament_target_dependencies (${PROJECT_NAME}
1315 rcl
Original file line number Diff line number Diff line change @@ -6,11 +6,10 @@ find_package(ament_cmake REQUIRED)
66find_package (rcl REQUIRED )
77find_package (rclc REQUIRED )
88find_package (example_interfaces REQUIRED )
9+ find_package (Threads REQUIRED )
910
1011add_executable (${PROJECT_NAME} main.c )
11-
12- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
13- SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread" )
12+ target_link_libraries (${PROJECT_NAME} Threads::Threads )
1413
1514ament_target_dependencies (${PROJECT_NAME}
1615 rcl
Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ find_package(rclc REQUIRED)
88find_package (std_msgs REQUIRED )
99find_package (rmw_microxrcedds REQUIRED )
1010find_package (micro_ros_utilities REQUIRED )
11+ find_package (Threads REQUIRED )
1112
1213add_executable (${PROJECT_NAME} main.c )
14+ target_link_libraries (${PROJECT_NAME} Threads::Threads )
1315
1416ament_target_dependencies (${PROJECT_NAME}
1517 rcl
You can’t perform that action at this time.
0 commit comments