Ask Your Question

Building-Problems with TimeSynchronizer

asked 2013-04-16 04:45:16 -0500

Waterplant gravatar image

Hi - I want to subscribe two topics of the Kinect (synchron). I followed the TimeSynchronizer Tutorial, but I have following errors when I build the code:

error: CMakeFiles/example.dir/src/test.o: undefined reference to symbol 'boost::signals::connection::~connection()'
error: note: 'boost::signals::connection::~connection()' is defined in DSO /usr/lib/ so try adding it to the linker command line

error: could not read symbols: Invalid operation error: collect2: ld returned 1 exit status

Here is the important part:

void callback (const sensor_msgs::ImageConstPtr& input_image, const sensor_msgs::ImageConstPtr& input_depth) { 
//opencv stuff

int main(int argc, char** argv) {
    ros::init(argc, argv, "hole_detection");

    ros::NodeHandle nh;


    message_filters::Subscriber<sensor_msgs::Image> image_sub(nh, "camera/rgb/image_rect_color", 1);
    message_filters::Subscriber<sensor_msgs::Image> depth_sub(nh, "camera/depth_registered/image_rect", 1);

    TimeSynchronizer<sensor_msgs::Image, sensor_msgs::Image> sync(image_sub, depth_sub, 10);
    sync.registerCallback(boost::bind(&callback, _1, _2));

    ros::spin ();
    return 0;

Thank you very much :)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-04-16 04:51:43 -0500

Thomas D gravatar image

I am assuming you are using rosmake and not catkin to build your node. In your CMakeLists.txt file add the following lines:

rosbuild_add_boost_directories ()
rosbuild_link_boost (${BINNAME} signals)

where ${BINNAME} is the name of the executable you are building with rosbuild_add_executable. Note that you have to add those two lines after the line with rosbuild_add_executable.

edit flag offensive delete link more

answered 2013-04-16 04:52:41 -0500

Waterplant gravatar image

Thank you very much! Exactly that was missing :) I hate boost

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-04-16 04:45:16 -0500

Seen: 103 times

Last updated: Apr 16 '13