Compilation problems with boost > 1.62

Issue #17 resolved
Leopold Palomo-Avellaneda created an issue

Building ueye with Debian buster that has Boost 1.67 fails in two files StereoNode.cpp i CameraNode.cpp

/srv/robotica/ros/src/ueye/ueye/src/StereoNode.cpp: In member function ‘bool ueye::StereoNode::setCameraInfo(sensor_msgs::SetCameraInfo::Request&, sensor_msgs::SetCameraInfo::Response&, ueye::Camera&, sensor_msgs::CameraInfo&)’:
/srv/robotica/ros/src/ueye/ueye/src/StereoNode.cpp:384:34: error: ‘format’ is not a member of ‘boost’
rsp.status_message = (boost::format("Camera_info resolution %ix%i does not match current video "
^~
/srv/robotica/ros/src/ueye/ueye/src/StereoNode.cpp:384:34: note: suggested alternative: ‘forward’
rsp.status_message = (boost::format("Camera_info resolution %ix%i does not match current video "
^~
forward
make[2]: *** [CMakeFiles/ueye_nodelets.dir/build.make:115: CMakeFiles/ueye_nodelets.dir/src/StereoNode.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1081: CMakeFiles/ueye_nodelets.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

The solution is quite easy, just:

diff -r 973c73c2bfce src/CameraNode.cpp
--- a/src/CameraNode.cpp Wed Nov 01 21:36:37 2017 +0000
+++ b/src/CameraNode.cpp Wed Sep 18 09:13:15 2019 +0200
@@ -33,6 +33,7 @@
*********************************************************************/

#include <ueye/CameraNode.h>
+#include <boost/format.hpp>

namespace ueye
{
diff -r 973c73c2bfce src/StereoNode.cpp
--- a/src/StereoNode.cpp Wed Nov 01 21:36:37 2017 +0000
+++ b/src/StereoNode.cpp Wed Sep 18 09:13:15 2019 +0200
@@ -33,6 +33,7 @@
*********************************************************************/

#include <ueye/StereoNode.h>
+#include <boost/format.hpp>

namespace ueye
{

Comments (2)

  1. Kevin Hallenbeck repo owner

    Fixed with PR #1. Thanks for the code submission.

    The devel branch also fixes this by switching to the standard library for formatting

  2. Log in to comment