交叉编译QT4.8.6遇到问题记录

PC:ubuntu14

工具链:arm-none-linux-gnueabi-  4.8.3

交叉编译QT遇到问题集锦,本人新手,问题较多。


1、configure QT的时候遇到这个问题:

The tslib functionality test failed!

      You might need to modify the include and library search paths by editing
      QMAKE_INCDIR and QMAKE_LIBDIR
导致这个的原因可能很多,所以需要在configure后面加上-verbose查看具体是报什么错
	1)找不到编译器这里要注意的就是configure里面要更改 -xplatform qws/linux-arm-gnueabi-g++,我之前是照搬网上的-xplatform  qws/linux-arm-g++ 
	2)skipping incompatible libts.so when searching for -lts
		 cannot find -lts

查看tslib编译过程和tslib下面的Makefile发现libts是gcc编译的,这里就是为什么incompatible的原因,但是我之前交叉编译工具是安装好的,这里再执行:

$ export PATH=$PATH:/usr/local/arm/arm-2014.5/bin
$ export CC=arm-none-linux-gnueabi-gcc
$ export CXX=arm-none-linux-gnueabi-g++

2、undefined reference to `__sync_add_and_fetch_4'

具体原因网上有,我是交叉编译器从4.4.1直接换到最新的4.8.3,问题解决了~

3、提示找不到libts的库

            lib/libQtGui.so: undefined reference to `ts_read_raw'
            lib/libQtGui.so: undefined reference to `ts_open'
            lib/libQtGui.so: undefined reference to `ts_fd'
            lib/libQtGui.so: undefined reference to `ts_config'
            lib/libQtGui.so: undefined reference to `ts_close'
            lib/libQtGui.so: undefined reference to `ts_read'
修改 qt-everywhere-opensource-src-4.8.6/mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf
在后面加上 -lts,这里红色部分要注意的是根据自己情况修改相应文件夹下的qmake.conf
QMAKE_CC                = arm-none-linux-gnueabi-gcc -lts
QMAKE_CXX               = arm-none-linux-gnueabi-g++ -lts
QMAKE_LINK              = arm-none-linux-gnueabi-g++ -lts
QMAKE_LINK_SHLIB        = arm-none-linux-gnueabi-g++ -lts
貌似上面的修改方法在后面编译非QT工程的时候有点不便,如果不做特别处理,每次会链接lts库报错,这里增加另外一种参考方法:
在qt_every_where目录下修改mkspecs/qws/common/linux.conf
在QMAKE_LIBS_THREAD     = -lpthread后增加-lts编程
QMAKE_LIBS_THREAD     = -lpthread -lts



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值