|
1Qter豆
系统:ubuntu12.04 qt版本:4.8.6
pc QT位置:/usr/local/Trolltech/qt-everywhere
pc端/etc/profile配置:
#for arm
export QTDIR=/usr/local/Trolltech/qt-everywhere
export PATH=$QTDIR/bin:/source/arm-gcc-4.6.4/binPATH
export LD_LIBRARY_PATH=$QTDIR/libLD_LIBRARY_PATH
export QMAKESPEC=$QTDIR/mkspecs/qws/linux-arm-g++
#echo $PATH 环境变量
/usr/local/Trolltech/qt-everywhere/bin:/source/arm-gcc-4.6.4/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/source/arm-gcc-4.6.4/bin:/source/arm-gcc-4.6.4/bin
ARM版qt位置:
usr/local/Trolltech/qt-everywhere
ARM端/etc/profile配置:
export LD_LIBRARY_PATH=/usr/local/Trolltech/qt-everywhere/lib:/usr/local/lib
qt代码:
#include <QApplication>
#include <QDialog>
#include <QPushButton>
#include <QLineEdit>
int main(int args,char**argv)
{
QApplication app(args,argv);
QDialog dlg;
dlg.resize(400,300);
dlg.move((1024-400)/2,(768-300)/2);
QPushButton btn(&dlg);
btn.resize(100,30);
btn.move(100,100);
btn.setText("ok");
QLineEdit edt(&dlg);
edt.resize(100,30);
edt.move(100,200);
edt.setText("ok");
dlg.setVisible(true);
return app.exec();
}
pc使用qte编译后,放入arm平台执行,提示:
[root@S5PV210 hello]# ./hello -qws
QLock:Lock: Cannot create semaphore /tmp/qtembedded-0/QtEmbedded-0 'd' (38, Function not implemented)
Cannot get display lock
Aborted
注:
内核使用3.0.8, System V IPC选项已经开启
qt移植脚本:
./configure -embedded arm -release -qt-mouse-linuxinput \
-opensource -fast -no-accessibility -qt-sql-sqlite -plugin-sql-sqlite \
-no-scripttools -multimedia -svg -shared -webkit -webkit-debug -silent \
-qt-libpng -qt-libjpeg -no-libtiff -make libs -nomake tools -nomake examples \
-nomake docs -nomake demo -no-nis -no-cups -iconv -no-dbus -no-openssl -xplatform \
qws/linux-arm-gnueabi-g++ -little-endian -qt-freetype -depths 16,32 -qt-gfx-linuxfb \
-no-gfx-transformed -no-gfx-multiscreen -no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput -no-glib
|
|