过程是痛苦的,因为之前没调试过qt,也没啥总结的,可能换个设备还是慢慢摸索调试
前文已介绍了如果编译 tslib和qt 且非常详细;那个步骤现在看没有问题
我在调试qt的时候 翻看了好多遍前文编译的库,看编译过程是否有问题;;;;我这不叫写文章 叫笔记
1.配置文件
这个在/etc/profile 中, 对tslib的一些配置;
export TSLIB_ROOT=/路径/tslib #设置一个根目录,方便更改
export TSLIB_TSDEVICE=/dev/input/event1 #根据实际情况更改,接入触摸屏后,生成的event设备节点
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf #tslib的配置文件,一般情况下不需要更改
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts #插件的目录
export TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal #校准后生成的校验文件
export TSLIB_CONSOLEDEVICE=none #终端控制台不需要
export TSLIB_FBDEVICE=/dev/fb1 #根据LCD屏幕对应的设备节点设置
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib #添加共享库的目录
export QWS_MOUSE_PROTO=tslib:/dev/input/event1 #QT输入设备的环境变量(不设置此项,校准后光标是准的,鼠标不准)
这个是个特例;在某块板子上,他原来支持的是wayland ,需要改成 Linuxfb的;
请仔细核对 /etc/profile 和 /etc/init.d/S50launcher
其实,所有的配置文件都要仔细的核对;
2. 常见错误
Failed to mmap framebuffer (Invalid argument)
linuxfb: Failed to initialize screen
no screens available, assuming 24-bit color
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/hann/m1808/thirdpart/qt-everywhere-src-5.12.9/arm-qt/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
Cannot create window: no screens available
Aborted
这些错误我都遇到过,还有系统重启 啥的;;网上都能搜到解决方案吧
最后看,还是前文提到的配置问题;
3. 调试
tslib下
qt应用程序
笔记:
我这个板子没有/usr/local/lib把所有的库都丢到
/usr/lib 下了;
qt和tslib的
配置文件:
然后,后面还添加了make sudo gcc因依赖库移植失败没添加上
在后来,添加大华驱动,
他所依赖的 usb和网络驱动