ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Linking errors installing and compiling ROS (OSX)

asked 2013-02-04 13:38:10 -0600

Hansg91 gravatar image

Hello,

I was having some problems before with linking TinyXML to my package, which I got to work now, but after that I received weird linking errors:

  Undefined symbols for architecture x86_64:
    "ros::init(int&, char**, std::string const&, unsigned int)", referenced from:
        _main in MotorController.cpp.o
    "ros::spin()", referenced from:
        _main in MotorController.cpp.o
  ld: symbol(s) not found for architecture x86_64

As if ROS was not compiled or not compiled properly. So I wanted to try and reinstall/recompile ROS so that I could be sure it was up to date. However compiling gives me a linking error now too :

==> make -j8 -l8 in '/Users/hansgaiser/ros_catkin_ws/build_isolated/class_loader'
Linking CXX shared library /Users/hansgaiser/ros_catkin_ws/devel_isolated/class_loader/lib/libclass_loader.dylib
ld: library not found for -lPocoFoundation

I have no idea what PocoFoundation and why it is no longer found. All my system dependencies are met, according to rosdep and I am trying to compile a fresh install of ROS.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-02-04 13:42:59 -0600

WilliamWoodall gravatar image

PocoFoundation is part of poco, ensure that poco is installed from homebrew (or what ever package manager you are using).

The first error can occur when you use the ros headers (ros.h) but do not link against the ros library. It might be that your package does not find_package(...) and then target_link_libraries(...) roscpp.

edit flag offensive delete link more

Comments

You are probably correct about the first error, but according to homebrew poco was installed. I uninstalled and reinstalled it but this did not solve the error. I see the libs are located at /usr/local/lib and /usr/local/Cellar/poco/1.4.5/lib.

Hansg91 gravatar image Hansg91  ( 2013-02-04 14:06:57 -0600 )edit

Do you have /usr/local/lib/libPocoFoundation.dylib?

WilliamWoodall gravatar image WilliamWoodall  ( 2013-02-04 14:41:17 -0600 )edit

Yes, /usr/local/lib/libPocoFoundation.15.dylib /usr/local/lib/libPocoFoundation.dylib /usr/local/lib/libPocoFoundationd.15.dylib /usr/local/lib/libPocoFoundationd.dylib Those are the files that I have there.

Hansg91 gravatar image Hansg91  ( 2013-02-04 22:13:38 -0600 )edit

In that case, I can only guess that the state of your build is stale, please remove your build and devel folder and rebuild everything in a clean terminal environment.

WilliamWoodall gravatar image WilliamWoodall  ( 2013-02-05 09:22:36 -0600 )edit

I don't know what exactly caused it, but I removed everything I could and started over, it seems to be resolved now. I believe the first error is also resolved by depending on roscpp. Now I have a new boost linking error, but thats for a new question.

Hansg91 gravatar image Hansg91  ( 2013-02-05 22:07:40 -0600 )edit

Most likely you built your workspace, then changed something in brew (uninstalled/updated poco) and then tried to build again with out of date information.

WilliamWoodall gravatar image WilliamWoodall  ( 2013-02-06 06:23:28 -0600 )edit

Question Tools

Stats

Asked: 2013-02-04 13:38:10 -0600

Seen: 983 times

Last updated: Feb 04 '13