error when cross compile qt-everywhere-opensource-src-4.6.2 and tslib-1.4
ld: warning: libts-0.0.so.0, needed by /home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so, not found (try using -rpath or -rpath-link) /home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_read_raw' /home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_open' /home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_fd' /home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_config' /home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_close' /home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_read' collect2: ld returned 1 exit status make: *** [oventimer] Error 1
I find the website below form google:
After looking at the Makefile that's generated by qmake, 4.5.3 inserted "-lts" in the LIBS variable whereas this is missing on 4.6.2. If I just add this to the Makefile then it links ok.
This is user error. This is what happens:
QtGui links against tslib. Linking works as the linkerline adds -L/path/to/tslib from the configure line.
However, when an example links against QtGui the example should not directly link against tslib. However, it is a dependency to QtGui, so the linker gets unresolved symbols because it can not find tslib.
It is not recommended using the -L flag from command line when cross-compiling, but altering the mkspec.
To solve this either put tslib in the linkers lookup path or add a rpath-link line to your makespec as:
QMAKE_LFLAGS += -Wl,-rpath-link=/path/to/tslib/lib
or...
set the environment variable LD_LIBRARY_PATH to add a path to the linkers loopup path.
I test this:
To solve this either put tslib in the linkers lookup path or add a rpath-link line to your makespec as:
QMAKE_LFLAGS += -Wl,-rpath-link=/path/to/tslib/lib
it works ok;
from :
http://bugreports.qt.nokia.com/browse/QTBUG-7855?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
http://www.qtforum.org/article/31460/qt-everywhere-make-for-arm-fails-tslib-0-0-so-0-not-found.html