Hello there!
I am having trouble with a ros project that thows curious errors when trying to catkin_make it. here is the error:
In file included from /usr/include/boost/function/detail/maybe_include.hpp:18:0,
from /usr/include/boost/function/detail/function_iterate.hpp:14,
from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52,
from /usr/include/boost/function.hpp:64,
from /opt/ros/indigo/include/ros/forwards.h:40,
from /opt/ros/indigo/include/ros/common.h:37,
from /opt/ros/indigo/include/ros/ros.h:43,
from /**"my cpp file in the line where i include <ros/ros.h>"**
/usr/include/boost/function/function_template.hpp: In instantiation of ‘static void
boost::detail::function::void_function_invoker1<FunctionPtr, R, T0>::invoke(boost::detail::function::function_buffer&, T0) [with FunctionPtr = void (*)(); R = void; T0 = const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >&]’:
/usr/include/boost/function/function_template.hpp:934:38: required from ‘void boost::function1<R, T1>::assign_to(Functor) [with Functor = void (*)(); R = void; T0 = const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >&]’
/usr/include/boost/function/function_template.hpp:722:7: required from ‘boost::function1<R, T1>::function1(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (*)(); R = void; T0 = const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >&; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
/usr/include/boost/function/function_template.hpp:1069:16: required from ‘boost::function<R(T0)>::function(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (*)(); R = void; T0 = const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >&; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
**"my cpp file"**.cpp:239:48: required from here
/usr/include/boost/function/function_template.hpp:112:11: error: too many arguments to function
BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS));
What i also don't get is that the error is first leading to the includes, but then the actual error aims into one of my files. The line targeted is as such (where server
is a boost::shared_ptr<interactive_markers::InteractiveMarkerServer>
):
server->insert(inter_marker, &functionName);
and a similar error on:
In file included from /usr/include/boost/function/detail/maybe_include.hpp:18:0,
from /usr/include/boost/function/detail/function_iterate.hpp:14,
from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52,
from /usr/include/boost/function.hpp:64,
from /opt/ros/indigo/include/ros/forwards.h:40,
from /opt/ros/indigo/include/ros/common.h:37,
from /opt/ros/indigo/include/ros/ros.h:43,
from **"my other cpp file where i include ros.h"**
/usr/include/boost/function/function_template.hpp: In instantiation of ‘static void boost::detail::function::void_function_invoker1<FunctionPtr, R, T0>::invoke(boost::detail::function::function_buffer&, T0) [with FunctionPtr = void (*)(std::basic_string<char>); R = void; T0 = const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >&]’:
/usr/include/boost/function/function_template.hpp:934:38: required from ‘void boost::function1<R, T1>::assign_to(Functor) [with Functor = void (*)(std::basic_string<char>); R = void; T0 = const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >&]’
/usr/include/boost/function/function_template.hpp:722:7: required from ‘boost::function1<R, T1>::function1(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (*)(std::basic_string<char>); R = void; T0 = const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >&; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
/usr/include/boost/function/function_template.hpp:1069:16: required from ‘boost::function<R(T0)>::function(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (*)(std::basic_string<char>); R = void; T0 = const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >&; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
**"my other cpp file"**.cpp:149:59: required from here
/usr/include/boost/function/function_template.hpp:112:11: error: could not convert ‘a0’ from ‘const boost::shared_ptr<const visualization_msgs::InteractiveMarkerFeedback_<std::allocator<void> > >’ to ‘std::basic_string<char>’
BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS));
where by similar i mean that the error also points to "BOOST_FUNCTION_RETURN", what differs is that in this case, the line in my code is (where menu_handler
is an interactive_markers::MenuHandler
):
menu_handler.insert("string", &functionName);
It might be helpful to mention that a similar use of the functions has worked when the variables were still defined in the same file, but i outsourced them into a header, which shouldn't really cause a problem, but seemingly does for reasons i dont understand.
I am using ros indigo (as i am updating an older project). Might be helpful to mention that the project also contains an rviz panel plugin, but that isn't where the error occurs. My CMakeLists.txt looks like this (i guess and hope that this is where the error is):
cmake_minimum_required(VERSION 2.8.3)
project(heika_panel)
find_package(catkin REQUIRED COMPONENTS rviz)
catkin_package(INCLUDE_DIRS include)
include_directories(include ${catkin_INCLUDE_DIRS})
link_directories(${catkin_LIBRARY_DIRS})
set(CMAKE_AUTOMOC ON)
if(rviz_QT_VERSION VERSION_LESS "5")
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui)
include(${QT_USE_FILE})
else()
message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets)
set(QT_LIBRARIES Qt5::Widgets)
endif()
add_definitions(-DQT_NO_KEYWORDS)
set(SRC_FILES
src/heika_panel.cpp
src/heika_display_path.cpp
src/heika_radius.cpp
)
add_library(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${catkin_LIBRARIES})
install(TARGETS
${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKI
N_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(FILES
plugin_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY media/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/media)
install(DIRECTORY icons/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/icons)
Thank you in advance and please tell me if you need any more information to diagnose this!
Originally posted by G on ROS Answers with karma: 46 on 2017-06-21
Post score: 0