0
$\begingroup$

Rosanswers logo

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 to ros::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 to ros::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


Originally posted by Tarik on ROS Answers with karma: 26 on 2011-07-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by Tarik with karma: 26 on 2011-08-02

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.