2012年(67)
分类: C/C++
2012-06-15 20:19:46
QT例子minehunt在开发板上运行
1.
直接在
4.6.3库下运行:[root@FriendlyARM /kangear]# qt ./minehunt -qws
./minehunt: error while loading shared libraries: libQtDeclarative.so.4: cannotopen shared object file: No such file or directory
缺少
libQtDeclarative.so.4(在/QtEmbedded-4.8.0-arm搜索):查看其属性:
结果是:
把这三个都弄到/lib中去,再次运行。
结果如下:(依次添加所缺的库)
[root@FriendlyARM /kangear]# qt ./minehunt -qws
./minehunt: error while loading shared libraries: libQtScript.so.4: cannot open shared object file: No such file or directory
[root@FriendlyARM /kangear]# qt ./minehunt -qws
./minehunt: error while loading shared libraries: libQtSvg.so.4: cannot open shared object file: No such file or directory
[root@FriendlyARM /kangear]#
[root@FriendlyARM /kangear]# qt ./minehunt -qws
./minehunt: error while loading shared libraries: libQtSql.so.4: cannot open shared object file: No such file or directory
[root@FriendlyARM /kangear]# qt ./minehunt -qws
./minehunt: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
[root@FriendlyARM /kangear]# qt ./minehunt -qws
./minehunt: error while loading shared libraries: libQtNetwork.so.4: cannot open shared object file: No such file or directory
[root@FriendlyARM /kangear]# qt ./minehunt -qws
./minehunt: error while loading shared libraries: libQtCore.so.4: cannot open shared object file: No such file or directory
2.
3.库全部放过之后再次运行如下:
[root@FriendlyARM /kangear]# qt ./minehunt -qws
QFontDatabase: Cannot find font directory /usr/local/Trolltech/QtEmbedded4.8.0-arm/lib/fonts - is Qt installed correctly?
Aborted
解决方法
:将/usr/local/Trolltech/QtEmbedded-4.8.0-arm 文件夹放到开发板Trolltech目录下运行如图所示(qml1):
串口信息:
[root@FriendlyARM /kangear]# qt ./minehunt -qws
qrc:minehunt.qml:61:23: Type Tile unavailable
qrc:MinehuntCore/Tile.qml:77:9: Type Explosion unavailable
qrc:MinehuntCore/Explosion.qml:43:1: module "Qt.labs.particles" is not installed
思考:
既然他知道去
/usr/local/Trolltech/QtEmbedded-4.8.0-arm/lib/找fonts,那么也能找库文件:把整个文件夹放到
Trolltech之后,把以上放过去的库文件删掉了也能够运行!
[root@FriendlyARM /kangear]# qt ./minehunt -qws
qrc:minehunt.
qml:61:23: Type Tile unavailableqrc:MinehuntCore/Tile.
qml:77:9: Type Explosion unavailableqrc:MinehuntCore/Explosion.
qml:43:1: module "Qt.labs.particles" is not installed分析:
都是qml,把qml目录放进看看:
运行成功(如图qml2):
完善后如图:
(Qml-扫雷)
观看视频:
总结,终于知道《我的Qt4.8配置》中“-importdir /qml //将qmlviewer编译到/qml目录”的用处了!(《我的Qt4.8配置》网址:http://blog.chinaunix.net/uid-26663150-id-3242320.html )