undefined reference to moveit core api
Description
When I compile my program which uses moveit, I got following error msgs:
undefined reference to `robot_model_loader::RobotModelLoader::RobotModelLoader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
undefined reference to `robot_model_loader::RobotModelLoader::~RobotModelLoader()'
undefined reference to `robot_model_loader::RobotModelLoader::~RobotModelLoader()'
Your environment
- ROS Distro: Kinetic
- OS Version: Ubuntu 16.04
- Binary build
- release version: 0.9.12
The code I am trying to compile
#include <pluginlib/class_loader.h>
#include <ros/ros.h>
// MoveIt!
#include <moveit/robot_model_loader/robot_model_loader.h>
#include <moveit/robot_model/robot_model.h>
#include <moveit/planning_interface/planning_interface.h>
#include <moveit/planning_scene/planning_scene.h>
#include <moveit/kinematic_constraints/utils.h>
#include <moveit_msgs/DisplayTrajectory.h>
#include <moveit_msgs/PlanningScene.h>
int main( int argc, char **argv ) {
ros::init( argc, argv, "move_group_testr" );
ros::AsyncSpinner spinner(1);
spinner.start();
ros::NodeHandle nh;
ros::NodeHandle nh_private("~");
robot_model_loader::RobotModelLoader robot_model_loader( "robot_description" );
return 0;
}
CMakeList.txt I'm using
...
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
intera_core_msgs
moveit_core
moveit_msgs
shape_msgs
message_generation
sensor_msgs
message_runtime
)
...
target_link_libraries(sawyer_collision_checker_node
${catkin_LIBRARIES}
${Boost_LIBRARIES}
)
Can you add the source code you're trying to compile that produces this error. Thanks.
Hi, I just added my code and CMake file. I'm also sure that following library /opt/ros/kinetic/lib/libmoveit_robot_model.so is included in ${catkin_LIBRARIES}