天嵌 ARM开发社区

 找回密码
 注册
查看: 2138|回复: 6

初装qt4编译第一个mainwindow

[复制链接]
麦子 发表于 2013-4-6 16:29:49 | 显示全部楼层 |阅读模式
按照天嵌的教材操作,arm的qmake都装好了,编译时出现Running build steps for project mainwindow...Starting: /opt/EmbedSky/qt-4.5/__install/arm/bin/qmake /opt/EmbedSky/qt-4.5/qt-embedded-linux-opensource-src-4.5.0/demos/mainwindow/mainwindow.pro -spec /opt/EmbedSky/qt-4.5/__install/arm/mkspecs/qws/linux-arm-g++ -r
Failure to open file: /opt/EmbedSky/qt-4.5/qt-embedded-linux-opensource-src-4.5.0/demos/mainwindow/Makefile
Unable to generate makefile for: /opt/EmbedSky/qt-4.5/qt-embedded-linux-opensource-src-4.5.0/demos/mainwindow/mainwindow.pro
Exited with code 5.
Error while building project mainwindow
When executing build step 'QMake'

怎么解决·亚瑟王
 楼主| 麦子 发表于 2013-4-6 16:35:28 | 显示全部楼层
求帮助呀  @亚瑟王
回复

使用道具 举报

 楼主| 麦子 发表于 2013-4-6 19:10:46 | 显示全部楼层
这问题解决了,权限问题,但是又出现问题
就是当编译pc版的时,执行./x86_project
再make
平台:ubuntu10.04
出现以下错误
root@dennis-desktop:/opt/EmbedSky/qt-4.5/pro/hello_cn# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o hello_cn.o hello_cn.cpp
In file included from hello_cn.cpp:24:
hello_cn.h:13:18: error: QtCore: 没有那个文件或目录
hello_cn.h:14:17: error: QtGui: 没有那个文件或目录
hello_cn.h:15:27: error: QtCore/QVariant: 没有那个文件或目录
hello_cn.h:16:25: error: QtGui/QAction: 没有那个文件或目录
hello_cn.h:17:30: error: QtGui/QApplication: 没有那个文件或目录
hello_cn.h:18:30: error: QtGui/QButtonGroup: 没有那个文件或目录
hello_cn.h:19:24: error: QtGui/QLabel: 没有那个文件或目录
hello_cn.h:20:25: error: QtGui/QWidget: 没有那个文件或目录
hello_cn.h:21:24: error: QPixmapCache: 没有那个文件或目录
hello_cn.h:22:19: error: QThread: 没有那个文件或目录
In file included from hello_cn.cpp:24:
hello_cn.h:26: error: expected class-name before ‘{’ token
hello_cn.h:27: error: ISO C++ forbids declaration of ‘Q_OBJECT’ with no type
hello_cn.h:28: error: expected ‘;’ before ‘public’
hello_cn.h:32:
回复

使用道具 举报

 楼主| 麦子 发表于 2013-4-6 19:11:52 | 显示全部楼层
快来人帮我解决这问题呀。。。。。
回复

使用道具 举报

TQ-lkp 发表于 2013-4-7 08:54:44 | 显示全部楼层
光盘中提供的qt无法编绎成x86的库,手册中说的这一点不对,你要重新下载pc上使用的qt源码重新编绎,或者使用操作系统自带的更新方式来下载qt库
回复

使用道具 举报

 楼主| 麦子 发表于 2013-4-7 13:47:22 | 显示全部楼层
我用那个qtopia装好了,但是编译出来出现这种
root@dennis-desktop:/opt/EmbedSky/Qte/x86-qtopia-2.2.0/pro/first# make
arm-linux-g++  -o /opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/image/opt/Qtopia/bin/first main.o first.o moc_first.o  -L/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/lib -L/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/lib -lm -lqpe -lqtopia -lqte
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/lib/libqpe.so when searching for -lqpe
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lqpe
collect2: ld returned 1 exit status
make: *** [/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/image/opt/Qtopia/bin/first] 错误
回复

使用道具 举报

TQ-lkp 发表于 2013-4-8 11:26:30 | 显示全部楼层
Qt的环境变量要设置
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2025-6-24 06:37 , Processed in 2.038228 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表