Skip to content

Fix boost::asio deprecations#17

Open
zimmerman-pliant wants to merge 1 commit into
UTNuclearRoboticsPublic:ros2from
Pliant-Energy:dz/fix-boost-failure
Open

Fix boost::asio deprecations#17
zimmerman-pliant wants to merge 1 commit into
UTNuclearRoboticsPublic:ros2from
Pliant-Energy:dz/fix-boost-failure

Conversation

@zimmerman-pliant

@zimmerman-pliant zimmerman-pliant commented Jun 16, 2026

Copy link
Copy Markdown

This fixes build failures related to deprecated API calls from boost::asio that have finally been removed in recent versions.

I've noticed this cropping up in a number of other ROS 2 packages. For example:

I don't know if this affects any mainstream Tier 1 ROS 2 distributions yet. I encountered it running ROS 2 Jazzy installed via Robostack released packages on a Raspberry Pi 5 with the following errors:

boost::asio build failures
(jazzy) <USER>@<COMPUTER>:~/ros2ws $ colcon build --merge-install --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to netft_utils
Starting >>> netft_interfaces
Finished <<< netft_interfaces [0.87s]
Starting >>> netft_utils
--- stderr: netft_utils
In file included from /home/<USER>/ros2ws/src/netft_utils/netft_utils/src/netft_rdt_driver.cpp:35:
/home/<USER>/ros2ws/src/netft_utils/netft_utils/include/netft_utils/netft_rdt_driver.h:88:16: error: 'io_service' in namespace 'boost::asio' does not name a type; did you mean 'use_service'?
   88 |   boost::asio::io_service io_service_;
      |                ^~~~~~~~~~
      |                use_service
/home/<USER>/ros2ws/src/netft_utils/netft_utils/src/netft_rdt_driver.cpp: In constructor 'netft_rdt_driver::NetFTRDTDriver::NetFTRDTDriver(const std::string&, const std::string&)':
/home/<USER>/ros2ws/src/netft_utils/netft_utils/src/netft_rdt_driver.cpp:287:11: error: 'io_service_' was not declared in this scope; did you mean 'rmw_service_t'?
  287 |   socket_(io_service_),
      |           ^~~~~~~~~~~
      |           rmw_service_t
/home/<USER>/ros2ws/src/netft_utils/netft_utils/src/netft_rdt_driver.cpp:300:67: error: 'from_string' is not a member of 'boost::asio::ip::address_v4'
  300 |   const udp::endpoint netft_endpoint(boost::asio::ip::address_v4::from_string(address), RDT_PORT);
      |                                                                   ^~~~~~~~~~~
/home/<USER>/ros2ws/src/netft_utils/netft_utils/src/netft_rdt_driver.cpp: In member function 'bool netft_rdt_driver::NetFTRDTDriver::readCalibrationInformation(const std::string&)':
/home/<USER>/ros2ws/src/netft_utils/netft_utils/src/netft_rdt_driver.cpp:354:34: error: 'io_service_' was not declared in this scope; did you mean 'rmw_service_t'?
  354 |   tcp::socket calibration_socket(io_service_);
      |                                  ^~~~~~~~~~~
      |                                  rmw_service_t
/home/<USER>/ros2ws/src/netft_utils/netft_utils/src/netft_rdt_driver.cpp:356:45: error: 'from_string' is not a member of 'boost::asio::ip::address'
  356 |     tcp::endpoint(boost::asio::ip::address::from_string(address), TCP_PORT));
      |                                             ^~~~~~~~~~~
gmake[2]: *** [CMakeFiles/netft_rdt_driver.dir/build.make:79: CMakeFiles/netft_rdt_driver.dir/src/netft_rdt_driver.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:159: CMakeFiles/netft_rdt_driver.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< netft_utils [8.63s, exited with code 2]

Summary: 1 package finished [9.72s]
  1 package failed: netft_utils
  1 package had stderr output: netft_utils

I haven't tested this extensively on other platforms, but it does build correctly on natively installed Jazzy on Ubuntu 24.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant