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

eros_qt_tutorials : link error undefined reference ros::console

asked 2011-07-20 04:43:02 -0600

Tarik gravatar image

updated 2011-07-21 00:32:56 -0600

Hi there

I am trying to compile the eros_qt_tutorials with the mingw cross-compiler. I get a load of undefined reference link errors and cannot find out what is missing. All the library paths are correct and the libros"blah".a files are all there.

The start of the errors is CMakeFiles/qtalker.dir/src/qnode.obj: In function QNode': /opt/ros/eros/tests/eros_qt_tutorials/qtalker/src/qnode.cpp:26: undefined reference toros::Publisher::~Publisher()' CMakeFiles/qtalker.dir/src/qnode.obj: In function ~QNode': /opt/ros/eros/tests/eros_qt_tutorials/qtalker/src/qnode.cpp:30: undefined reference toros::shutdown()'

The only clue I have and I don't know if it's related because librosconsole.a gets built anyway, but I get the error

opt/mingw/usr/i686-pc-mingw32/lib/libboost_thread-mt.a: member /opt/mingw/usr/i686-pc-mingw32/lib/libboost_thread-mt.a(thread.o) in archive is not an object collect2: ld returned 1 exit status make[3]: * [../examples/example] Error 1

when calling make in the rosconsole folder. I'm assuming this is irrelevent because it's trying to compile examples after rosconsole. However libboost_thread-mt.a is linked with for compiling eros_qt_tutorials, and looking in /opt/mingw/usr/i686-pc-ming232/lib, there are the symbolic links libboost_thread-mt.a -> /opt/mingw/usr/i686-pc-mingw32/lib/libboost_thread_win32-mt.a libboost_thread-mt-d.a -> /opt/mingw/usr/i686-pc-mingw32/lib/libboost_thread_win32-mt-d.a

libboost_thread_win32-mt.a and libboost_thread_win32-mt-d.a are both there though so I don't know what the problem is.

I am running diamondback on ubuntu lucid and have not modified the manifest.xml or any code and the mingw cross compiler is definitely getting called.

Thanks for any help

Tarik

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-08-02 21:30:11 -0600

Tarik gravatar image

OK, fixed this problem. In short, the libraries were not cross-compiled properly.

The lib.a files seemed not to have been built by the cross-compiler as when I checked their contents using nm, they looked like .so libraries. This would explain why ros::init or any ros function called in the qt program was generating a link error. I built them again, making sure the cross-compiler was being called and this time the output from nm was showing .obj contents in each lib.a, which is correct.

qtalker.exe and other exes were produced fine and they run on Windows.

T

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-07-20 04:43:02 -0600

Seen: 689 times

Last updated: Aug 02 '11