Why do I get this error when catkin_make my package?
Linking CXX executable /home/joao/catkin_ws/devel/lib/testbot_description/parser /opt/ros/hydro/lib/liburdf.so: undefined reference to `ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)' /opt/ros/hydro/lib/liburdf.so: undefined reference to `ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > const&, char const*, int, char const*)' collect2: ld returned 1 exit status make[2]: *** [/home/joao/catkin_ws/devel/lib/testbot_description/parser] Error 1 make[1]: *** [testbot_description/CMakeFiles/parser.dir/all] Error 2 make: *** [all] Error 2 Invoking "make" failed
[ROS Hydro and Ubuntu 12.04]
I am trying to follow the urdf parser tutorial.
My testbot_description
package has a /src/parser.cpp
file and a /urdf/my_robot.urdf
file
Both are identical to the ones suggested by the tutorial page. (I already copied and pasted the code to make sure).
This is my CMakeLists:
cmake_minimum_required(VERSION 2.8.3)
project(testbot_description)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS urdf)
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES testbot_description
# CATKIN_DEPENDS urdf
# DEPENDS system_lib
)
include_directories(
${catkin_INCLUDE_DIRS}
)
add_executable(parser src/parser.cpp)
target_link_libraries(parser ${catkin_LIBRARIES})
And this is my package.xml
:
<package>
<name>testbot_description</name>
<version>0.0.1</version>
<description>The testbot_description package</description>
<maintainer email="joao.cicero@ifce.edu.br">Joao Cicero</maintainer>
<license>BSD</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>urdf</build_depend>
<run_depend>urdf</run_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- You can specify that this package is a metapackage here: -->
<!-- <metapackage/> -->
<!-- Other tools can request additional information be placed here -->
</export>
</package>
Please also post your package.xml
Thanks, BennyRe. I just added it. I hope it will help.
I just realized that when I comment the code that calls for initFile() I get rid of this error and I am able to build my package. In my parser.cpp , if I keep the " if (!model.initFile(urdf_file)) { ROS_ERROR("Failed to parse urdf file"); return -1; } " the error appears again.