From 20009322150c5f43a3f7814b28c2ef18e222f0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Tue, 11 Aug 2020 03:03:39 +0200 Subject: [PATCH] [Gazebo9] Fixed fails for OSX: Added using namespace boost::placeholders (#2809) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Co-authored-by: Jose Luis Rivero Co-authored-by: Louise Poubel Co-authored-by: Steve Peters --- examples/stand_alone/custom_main_pkgconfig/CMakeLists.txt | 6 ++++++ gazebo/gui/model/ModelTreeWidget.cc | 6 ++++++ gazebo/gui/model/SchematicViewWidget.cc | 6 ++++++ test/plugins/ForceTorqueModelRemovalTestPlugin.cc | 5 ++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/examples/stand_alone/custom_main_pkgconfig/CMakeLists.txt b/examples/stand_alone/custom_main_pkgconfig/CMakeLists.txt index c99ca11eae..3b53c22df5 100644 --- a/examples/stand_alone/custom_main_pkgconfig/CMakeLists.txt +++ b/examples/stand_alone/custom_main_pkgconfig/CMakeLists.txt @@ -12,3 +12,9 @@ link_directories(${GAZEBO_LIBRARY_DIRS}) add_executable(custom_main custom_main.cc) target_link_libraries(custom_main ${GAZEBO_LIBRARIES}) + +if(${CMAKE_VERSION} VERSION_LESS "3.13.0") + link_directories(${Boost_LIBRARY_DIRS}) +else() + target_link_directories(custom_main PUBLIC ${Boost_LIBRARY_DIRS}) +endif() diff --git a/gazebo/gui/model/ModelTreeWidget.cc b/gazebo/gui/model/ModelTreeWidget.cc index 860b930a5f..14f52ca4cb 100644 --- a/gazebo/gui/model/ModelTreeWidget.cc +++ b/gazebo/gui/model/ModelTreeWidget.cc @@ -15,6 +15,8 @@ * */ +#include + #include "gazebo/common/Events.hh" #include "gazebo/gui/GuiEvents.hh" @@ -160,6 +162,10 @@ ModelTreeWidget::ModelTreeWidget(QWidget *_parent) this->layout()->setContentsMargins(0, 0, 0, 0); // Connections + #if BOOST_VERSION >= 107300 + using namespace boost::placeholders; + #endif + this->connections.push_back( gui::model::Events::ConnectSaveModel( boost::bind(&ModelTreeWidget::OnSaveModel, this, _1))); diff --git a/gazebo/gui/model/SchematicViewWidget.cc b/gazebo/gui/model/SchematicViewWidget.cc index 957a41f64b..8a40be569e 100644 --- a/gazebo/gui/model/SchematicViewWidget.cc +++ b/gazebo/gui/model/SchematicViewWidget.cc @@ -15,6 +15,8 @@ * */ +#include + #include #include "gazebo/rendering/Material.hh" @@ -82,6 +84,10 @@ void SchematicViewWidget::Reset() ///////////////////////////////////////////////// void SchematicViewWidget::Init() { + #if BOOST_VERSION >= 107300 + using namespace boost::placeholders; + #endif + this->connections.push_back(gui::model::Events::ConnectLinkInserted( boost::bind(&SchematicViewWidget::AddNode, this, _1))); diff --git a/test/plugins/ForceTorqueModelRemovalTestPlugin.cc b/test/plugins/ForceTorqueModelRemovalTestPlugin.cc index 70d7d9ddbb..6cccd943b8 100644 --- a/test/plugins/ForceTorqueModelRemovalTestPlugin.cc +++ b/test/plugins/ForceTorqueModelRemovalTestPlugin.cc @@ -15,6 +15,8 @@ * */ +#include + #include "plugins/ForceTorqueModelRemovalTestPlugin.hh" #include "gazebo/sensors/ForceTorqueSensor.hh" @@ -53,7 +55,8 @@ void ForceTorqueModelRemovalTestPlugin::Load(sensors::SensorPtr _sensor, // Create connection this->updateConnection = gazebo::event::Events::ConnectWorldUpdateBegin( - boost::bind(&ForceTorqueModelRemovalTestPlugin::onUpdate, this, _1)); + std::bind(&ForceTorqueModelRemovalTestPlugin::onUpdate, this, + std::placeholders::_1)); } void ForceTorqueModelRemovalTestPlugin::onUpdate(