QT移植中的一些问题
2016-06-10 09:33
513 查看
http://zhuhaibobb.blog.163.com/blog/static/27440067201061341131184/
Hardware:
AT91SAM9263
Software:
qt-embedded-linux-opensource-src-4.4.3.tar.gz
qt-x11-opensource-src-4.4.3.tar.gz
arm-linux-gcc-3.4.1.tar.bz2
tslib-1.4.tar.gz
Before we begin the installation, we have to install some tools first:
1. automake
2. autoconf
3. libtool
4. libxtst-dev
5. minicom / cu
1) Install Arm-Linux-GCC-3.4.1:
2) Compiling tslib-1.4 (Touch Screen Library):
I installed tslib to /opt/tslib
If you got an error like this while you were compiling:
means that you have not installed 'libtool' yet.
3) Compiling Qt-X11:
A couple hours later...
4) Compiling Qt-Embedded:
See configure
options(Qt Embedded) for your
requests
A few times I tried then I got errors like this :
I think that would be an environment setting error about arm compiler.
Modifying configure file:
5) Setup Environment Variables:
2 ways to add the environment parameters.
(1)Modifying ~/.bashrc for current user.
(2)Modifying /etc/profile for All users(include root & users).
e.g.
6) Porting QT-Embedded:
I copied library & plugins to /opt/qt.
Create Links:
I used Minicom & TFTP to burn files into the board. Just like...
Another way to log in.
If got error like this while using cu.
Fix it :
After we'd been logging in embedded system.
7) Hello World:
Snippet
Code:
OriginalCopyPrint?
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.show();
return app.exec();
}
#include <QApplication> #include <QPushButton> int main(int argc, char *argv[]) {
QApplication app(argc, argv); QPushButton hello("Hello world!"); hello.show(); return app.exec(); }Run on ARM.
Some errors I collected from internet & sorted out here.
1.
This means that you need to copy librt.so.1 library into your board.
2.
You properbly need to re-configure your qt-embedded.
Try to remove "-depths" option from configure options.
3.
See this page:Qt/E
4.x
Try to add "-fn DejaVuSans" option. E.g.
4.
This would be needed to reset tslib environment variables.
5.
This means that you have to change environment varaibles about QWS_MOUSE_PROTO andTSLIB_TSDEVICE
Hardware:
AT91SAM9263
Software:
qt-embedded-linux-opensource-src-4.4.3.tar.gz
qt-x11-opensource-src-4.4.3.tar.gz
arm-linux-gcc-3.4.1.tar.bz2
tslib-1.4.tar.gz
Before we begin the installation, we have to install some tools first:
1. automake
2. autoconf
3. libtool
4. libxtst-dev
5. minicom / cu
1) Install Arm-Linux-GCC-3.4.1:
#mv arm-linux-gcc-3.4.1.tar.bz2 / #tar jxf arm-linux-gcc-3.4.1.tar.bz2 #export /usr/local/arm/3.4.1/bin |
I installed tslib to /opt/tslib
#tar zxf tslib-1.4.tar.gz #cd tslib #vi etc/ts.conf ... # Uncomment if you wish to use the linux input layer event interface module_raw input /*Uncomment this line*/ ... #./autogen.sh /*this produces './configure' file */ #mkdir /opt/tslib /*path of destination for installing */ #./configure --prefix=/opt/tslib CC=arm-linux-gcc CXX=arm-linux-g++ --host=arm-linux ac_cv_func_malloc_0_nonnull=yes #make #make install |
configure.ac:25: error: possibly undefined macro: AC_DISABLE_STATIC If this token and others are legitimate, please use m4_pattern_allow. See the Aut 4000 oconf documentation. configure.ac:26: error: possibly undefined macro: AC_ENABLE_SHARED configure.ac:27: error: possibly undefined macro: AC_LIBTOOL_DLOPEN configure.ac:28: error: possibly undefined macro: AC_PROG_LIBTOOL autoreconf: /usr/bin/autoconf failed with exit status: 1 |
3) Compiling Qt-X11:
#cd qt-x11-opensource-src-4.4.3/ #./configure -qvfb #make #make install |
4) Compiling Qt-Embedded:
See configure
options(Qt Embedded) for your
requests
A few times I tried then I got errors like this :
... tslib functionality test failed You might need to modify the include and library search paths by editing QMAKE_INCDIR and QMAKE_LIBDIR in /home/robert/my_work/qt-embedded-linux-opensource-src-4.4.3/mkspecs/qws/linux-arm-g++ |
Modifying configure file:
#cd qt-embedded-linux-opensource-src-4.4.3 #vim mkspecs/qws/linux-arm-g++/qmake.conf ... QMAKE_CC = arm-linux-gcc QMAKE_CXX = arm-linux-g++ QMAKE_LINK = arm-linux-g++ QMAKE_LINK_SHLIB = arm-linux-g++ QMAKE_AR = arm-linux-ar cqs QMAKE_OBJCOPY = arm-linux-objcopy QMAKE_RANLIB = arm-linux-ranlib QMAKE_STRIP = arm-linux-strip ... #./configure -prefix /usr/local/qt \ -fast \ -embedded arm \ -xplatform qws/linux-arm-g++ \ -no-largefile \ -qt-sql-sqlite \ -no-qt3support \ -no-phonon \ -no-svg \ -no-webkit \ -no-assistant-webkit \ -no-mmx \ -no-3dnow \ -no-sse \ -no-sse2 \ -no-opengl \ -qt-zlib \ -qt-gif \ -qt-libtiff \ -qt-libpng \ -qt-libmng \ -qt-libjpeg \ -no-openssl \ -nomake translations \ -nomake docs \ -make libs \ -make tools \ -no-dbus \ -little-endian \ -feature-THREAD \ -feature-CONCURRENT \ -qt-gfx-linuxfb \ -qt-gfx-vnc \ -no-gfx-qvfb -no-kbd-qvfb -no-mouse-qvfb \ -qt-kbd-usb \ -qt-mouse-tslib \ -I/opt/tslib/include \ /*include path of tslib*/ -L/opt/tslib/lib \ /*library path of tslib*/ -v -silent > log_cfg 2>&1 #make && make install |
2 ways to add the environment parameters.
(1)Modifying ~/.bashrc for current user.
(2)Modifying /etc/profile for All users(include root & users).
e.g.
#vi /etc/profile ... export PATH=$PATH:/usr/local/arm/3.4.1/bin:/usr/local/qte/bin ... #source /etc/profile /*Apply settings immediately*/ |
I copied library & plugins to /opt/qt.
#cp -R /usr/local/qte/lib/libQt*.so.4.4.3 /opt/qt #cp -R /usr/local/qte/plugins/imageformats /opt/qt/plugins #cp -R /usr/local/qte/lib/fonts /opt/qt/lib |
#cd /opt/qt/lib #ln -s libQtCore.so.4.4.3 libQtCore.so.4 #ln -s libQtGui.so.4.4.3 libQtGui.so.4 #ln -s libQtNetwork.so.4.4.3 libQtNetwork.so.4 #ln -s libQtSql.so.4.4.3 libQtSql.so.4 #ln -s libQtScript.so.4.4.3 libQtScript.so.4 #ln -s libQtXml.so.4.4.3 libQtXml.so.4 #ln -s libQtTest.so.4.4.3 libQtTest.so.4 #tar zcf /opt/qt.tar.gz /opt/qt #tar zcf /opt/tslib.tar.gz /opt/tslib |
#minicom -s ... +-----[configuration]-----+ Filenames and paths File transfer protocols Serial port setup <-- Choose this to configure serial port Modem and dialing Screen and keyboard Save setup as df1 <-- Choose this to save settings Save setup as .. Exit <-- Choose this to back to minicom screen Exit from Minicom ... =====Modify settings like this === A- Serial Device : /dev/ttyS0 B- Lockfile Location : /var/lock C- Callin Program : D- Callout Program : E- Bps/Par/Bits : 115200 8N1 F- Hardware Flow Control : No G- Software Flow Control : No ... |
#cu -l /dev/ttyS0 -s 115200 --nostop |
cu: open (/dev/ttyS0): Permission denied cu: /dev/ttyS0: Line in use |
#chgrp dialout /dev/ttyS0 or #chmod 666 /dev/ttyS0 |
#ifconfig eth0 192.168.1.33 /*Source IP*/ #tftp -g -l qt.tar.gz 192.168.1.34 /*Destination IP*/ #mv qt.t e220 ar.gz /opt #tar zxf qt.tar.gz #tftp -g -l tslib.tar.gz 192.168.1.34 #mv tslib.tar.gz /opt #tar zxf tslib.tar.gz #vi /etc/profile ... export QTDIR=/opt/qt export TSDIR=/opt/tslib export PATH=$QTDIR:$QTDIR/plugins:$TSDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/plugins/imageformats:$TSDIR/lib:$LD_LIBRARY_PATH export QT_PLUGIN_PATH=$QTDIR/plugins/ export QT_QWS_FONTDIR=$QTDIR/lib/fonts export QWS_DISPLAY="LinuxFb:/dev/fb0" #export QWS_DISPLAY="LinuxFb:mmWidth100:mmHeight130:0" /*Optional*/ export QWS_SIZE=240x320 export QWS_MOUSE_PROTO="tslib:/dev/event0" export TSLIB_CALIBFILE="/etc/pointercal" /*this file would be created by executing ts_calibrate*/ export TSLIB_CONFFILE="/opt/tslib/etc/ts.conf" export TSLIB_CONSOLEDEVICE="none" export TSLIB_FBDEVICE="/dev/fb0" export TSLIB_PLUGINDIR=$TSDIR/lib/ts export TSLIB_TSDEVICE="/dev/event1" ... #source /etc/profile |
Snippet
Code:
OriginalCopyPrint?
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.show();
return app.exec();
}
#include <QApplication> #include <QPushButton> int main(int argc, char *argv[]) {
QApplication app(argc, argv); QPushButton hello("Hello world!"); hello.show(); return app.exec(); }Run on ARM.
#./hello -qws |
1.
error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory |
2.
blit_setup(): Screen depth 15 not supported! / solidFill_setup(): Screen depth 15 not supported! |
Try to remove "-depths" option from configure options.
3.
Initializing QFontEngineQPF failed for /usr/local/qt/lib/fonts/DejaVuSans.ttf |
4.x
Try to add "-fn DejaVuSans" option. E.g.
./hello -qws -fn DejaVuSans |
QWSSocket::connectToLocalFile could not connect:: Connection refused / Segmentation fault |
5.
selected device is not a touchscreen I understand |
相关文章推荐
- QT编程中的-qws
- pyqt 动态增加 下拉框 标签 显示不全
- Qt-4.7.1编译全过程
- QT学习小结之信号与槽
- QT编程中mysql数据库的时间、日期的运用
- Qt之JSON生成与解析
- 将 PyQt 集成到 pycharm
- Qt代码段1
- 在QtCreator中使用doxygen
- LINUX下QT FOR ARM开发环境搭建过程 (使用qt-x11-opensource-src-4.5.2.tar.gz进行编译)
- qt中MVC的model的执行过程分析
- Ubuntu 14.04+Opencv-2.4.9+Qt配置
- VS+QT+OSG开发环境搭建及测试
- QT 静态编译后中文可能会出现乱码
- Qt之QSpacerItem
- Qt之QSpacerItem
- QCustomPlot绘制时间日期折线图
- Qt之QStackedWidget
- Qt之QStackedWidget
- Ubuntu 安装Qt开发环境(转)