系统教程
您现在的位置是:首页>服务器系统>Linux系统内容

Qt编译时出错为warning: libts-1.0.so.0,needed by /myroot/qt/

时间:2018-05-11 出处:未知复制分享人气(次) 【

运行平台:ubuntu16.04 +Qt4.8
 
出错原因:用Qt4.8编译时qmake后,运行make出现错误,错误为:
usr/local/toolschain/4.4.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libts-1.0.so.0, needed by /myroot/qt/qtlib/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/myroot/qt/qtlib/lib/libQtGui.so: undefined reference to `ts_read_raw'
/myroot/qt/qtlib/lib/libQtGui.so: undefined reference to `ts_open'
/myroot/qt/qtlib/lib/libQtGui.so: undefined reference to `ts_fd'
/myroot/qt/qtlib/lib/libQtGui.so: undefined reference to `ts_config'
/myroot/qt/qtlib/lib/libQtGui.so: undefined reference to `ts_close'
/myroot/qt/qtlib/lib/libQtGui.so: undefined reference to `ts_read'
collect2: ld returned 1 exit status
Makefile:120: recipe for target '机房监控之中控机' failed
make: *** [机房监控之中控机] Error 1
Qt编译时出错为warning: libts-1.0.so.0,needed by /myroot/qt/
 
说明:我的qt安装在/myroot/qt/qtlab下。
 
解决方法:
1.在里的项目目录下打开Makefile,在第十九行LIBS 最后添加-lts后保存退出。
Qt编译时出错为warning: libts-1.0.so.0,needed by /myroot/qt/
2.之后运行make,(特别特别注意的是更改完makefile后不能运行qmake,应该运行make,运行qmake的意思是生成Makefile文件,你改完makefile后运行qmake就是重新生成makefile,之前的改变就被覆盖了,相当于我们什么也没做,我就因为一直改makefile一直qmake,陷入无线循环中,困扰了好久)
Qt编译时出错为warning: libts-1.0.so.0,needed by /myroot/qt/
3.make后错误消失,成功编译。
4.谢谢阅读,希望可以帮你解决错误,对你有所帮助!
5.最后补充一下,上文所说的qmake是我的老师给的一个脚本。
 
多说几句吧!我的qt4.8的解压到最后编译过程:
1.压缩包:qt-everywhere-opensource-src-4.8.3.tar.gz
2.解压:tar -xvf  qt-everywhere-opensource-src-4.8.3.tar.gz
3.执行脚本,脚本自己命名一个名字就行,权限给777就行,放于解压后的目录
Qt编译时出错为warning: libts-1.0.so.0,needed by /myroot/qt/
4.eg:我的,执行./qt_config.sh
5.然后执行make -j4
6.执行make install
6.qt安装成功。
7.附录:为方便伙伴们的复制,脚本的代码如下:
./configure --prefix=/myroot/qt/qtlib -embedded arm -release -opensource -fast -no-accessibility -no    -scripttools -no-mmx -no-multimedia -no-svg  -no-webkit  -no-3dnow  -no-sse  -no-sse2  -silent  -qt-libpng     -qt-libjpeg -no-libtiff -no-multimedia -make libs -nomake tools -nomake examples -nomake docs -nomake demo -no-nis -no-cups -no-iconv -no-dbus -no-openssl -xplatform qws/linux-arm-gnueabi-g++ -little    -endian -qt-freetype -depths 16,18,32 -qt-gfx-linuxfb -no-gfx-transformed -no-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput -no-glib -qt-mouse-tslib -I/myroot/qt/tslib/include -L/myroot/qt/tslib/lib
声明:有三个路径可以执行指定
111....--prefix=/myroot/qt/qtlib 
222....-I/myroot/qt/tslib/include
333....-L/myroot/qt/tslib/lib
你也可以在想要安装的路径下建一个文件夹qt,在qt下建一个qtlib文件夹和一个tslib文件夹,在脚本指定就好。
8.折腾了好久,最后要感谢老师的指导和帮助,自己亲身解决过一些问题真的是对以后处理问题是有所帮助的,遇到问题先冷静,慢慢思考。
    最新资讯
    热门内容
    小米移动电源能为iPad mini充几次电