天嵌 ARM开发社区

 找回密码
 注册
查看: 4983|回复: 9

first make不成功!

[复制链接]
sunhy1021 发表于 2009-12-3 17:02:37 | 显示全部楼层 |阅读模式
我按照PDF来做,最后make,显示下面的内容:
[root@iFico hello]# make
Makefile:127: warning: overriding commands for target `moc_hello.cpp'
Makefile:124: warning: ignoring old commands for target `moc_hello.cpp'
g++ -c -pipe -Wall -W -O2  -o hello.o hello.cpp
In file included from hello.cpp:10:
hello.h:13:22: qvariant.h: 没有那个文件和目录
hello.h:14:21: qwidget.h: 没有那个文件和目录
In file included from hello.cpp:10:
hello.h:23: parse error before `{' token
hello.h:28: destructors must be member functions
hello.h:34: parse error before `public'
hello.cpp:12:22: qvariant.h: 没有那个文件和目录
hello.cpp:13:20: qlabel.h: 没有那个文件和目录
hello.cpp:14:25: qpushbutton.h: 没有那个文件和目录
hello.cpp:15:21: qlayout.h:没有那个文件和目录
hello.cpp:16:22: qtooltip.h: 没有那个文件和目录
hello.cpp:17:24: qwhatsthis.h: 没有那个文件和目录

hello.cpp:23: `QWidget' was not declared in this scope
hello.cpp:23: `parent' was not declared in this scope
hello.cpp:23: parse error before `char'
hello.cpp:24: invalid use of undefined type `class hello'
hello.h:22: forward declaration of `class hello'
hello.cpp: In constructor `hello::hello(...)':
hello.cpp:24: `parent' undeclared (first use this function)
hello.cpp:24: (Each undeclared identifier is reported only once for each
   function it appears in.)
hello.cpp:24: `name' undeclared (first use this function)
hello.cpp:24: `fl' undeclared (first use this function)
hello.cpp:24: class `hello' does not have any field named `QWidget'
hello.cpp:27: `setName' undeclared (first use this function)
hello.cpp:29: invalid use of undefined type `struct QLabel'
hello.h:19: forward declaration of `struct QLabel'
hello.cpp:30: `QRect' undeclared (first use this function)
hello.cpp:31: `QFont' undeclared (first use this function)
hello.cpp:31: parse error before `(' token
hello.cpp:32: `user_t_font' undeclared (first use this function)
hello.cpp:32: `TRUE' undeclared (first use this function)
hello.cpp:35: invalid use of undefined type `struct QPushButton'
hello.h:20: forward declaration of `struct QPushButton'
hello.cpp:38: invalid use of undefined type `struct QPushButton'
hello.h:20: forward declaration of `struct QPushButton'
hello.cpp:40: `languageChange' undeclared (first use this function)
hello.cpp:41: `QSize' undeclared (first use this function)
hello.cpp:41: `minimumSizeHint' undeclared (first use this function)
hello.cpp:41: `resize' undeclared (first use this function)
hello.cpp:44: `clicked' undeclared (first use this function)
hello.cpp:44: `SIGNAL' undeclared (first use this function)
hello.cpp:44: `user_button' undeclared (first use this function)
hello.cpp:44: `SLOT' undeclared (first use this function)
hello.cpp:44: `connect' undeclared (first use this function)
hello.cpp:45: `close' cannot be used as a function
hello.cpp: At global scope:
hello.cpp:52: invalid use of undefined type `class hello'
hello.h:22: forward declaration of `class hello'
hello.cpp:61: invalid use of undefined type `class hello'
hello.h:22: forward declaration of `class hello'
hello.cpp: In member function `void hello::languageChange()':
hello.cpp:62: `tr' undeclared (first use this function)
hello.cpp:62: `setCaption' undeclared (first use this function)
hello.cpp:63: `QString' undeclared (first use this function)
hello.cpp:63: parse error before `::' token
hello.cpp: At global scope:
hello.cpp:69: invalid use of undefined type `class hello'
hello.h:22: forward declaration of `class hello'
make: *** [hello.o] Error 1

上面的“hello.h:13:22: qvariant.h: 没有那个文件和目录”我在makefile里添加了它的路径:
main.o: main.cpp \
                hello.h \
               /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/qpeglobal.h \
              /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/qcom.h \
              /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/quuid.h \
               /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/qtopiawinexport.h \
               /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/timestring.h \
                /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/applicationinterface.h
为什么还说找不到头文件呢?

我在论坛里看到一些帖子,遇到过类似情况,但是没有解决,希望版主能解决下》!!!
juweihuang 发表于 2009-12-4 02:47:56 | 显示全部楼层
不好意思, 我提供一下拙見, 我懷疑你的一些檔案的安裝路徑
是否正確. 所以我有問管理員(在其他的帖子), 最好一步一步來,
否則前面錯, 後面會跟著全錯.....
回复

使用道具 举报

 楼主| sunhy1021 发表于 2009-12-4 11:14:02 | 显示全部楼层
2# juweihuang


我开始以为是路径的问题,但找了下。路径是没有问题的!
qpeglobal.h 文件就是在/opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/目录下,Makefile里是这样的。
回复

使用道具 举报

juweihuang 发表于 2009-12-4 12:20:50 | 显示全部楼层
不好意思, 我也是剛開始學嵌入式的東西, 所以還有很多在摸索中.
其實我也想幫大家一下, 只是我連那些檔案要解開都還不清楚......
就像我解開一個檔案, 裡面(Qte夾)又有一些 tar.bz2 檔案........
不知到底要如何...你的問題我早晚也會遇到, 如果我解開了,
定當給你解答.祝我好運.
回复

使用道具 举报

亚瑟王 发表于 2009-12-5 11:17:57 | 显示全部楼层
1、你在编译这个时是否设置了环境变量. setxxxx那个文件。
2、你在编译hello之前是否成功编译了qtopia?
回复

使用道具 举报

 楼主| sunhy1021 发表于 2009-12-7 09:41:50 | 显示全部楼层
5# 亚瑟王


1、你在编译这个时是否设置了环境变量. setxxxx那个文件。
我用的是1.7平台,直接用.set-env
2、你在编译hello之前是否成功编译了qtopia?
qtopia已经成功编译。
回复

使用道具 举报

 楼主| sunhy1021 发表于 2009-12-10 14:33:09 | 显示全部楼层
重做了下,又可以了,主要原因还是不知道!不过已经做出来了,还是高兴下!
回复

使用道具 举报

周工 发表于 2009-12-11 12:32:52 | 显示全部楼层
就算是大拿first make也很难弄出来,呵呵
回复

使用道具 举报

亚瑟王 发表于 2009-12-11 17:28:29 | 显示全部楼层
make出错是因为tmake制作的Makefile文件有很多重复的内容,我在手册里面特意贴出来了Makefile文件全部内容而没有特意讲明这件事情,有一个很小的用意:做事要仔细。呵呵,其实我这种习惯很不好,因为很多时候既给自己找麻烦,又不讨客户好。
1、如果没有编译成功,那些头文件的路径是不会存在的,只有编译成功了才会存在;
2、那些头文件的路径是正确的,它也在物理上存在,为什么系统找不到呢?因为编译时使用了变量QTDIR和QPEDIR,这两个变量在哪里定义的呢?设置环境变量时定义的。
所以我在回答时问了这两条。你后来成功了,应该是正确设置了环境变量,你可以使用ls $(QPEDIR)看看。
回复

使用道具 举报

 楼主| sunhy1021 发表于 2009-12-14 17:58:39 | 显示全部楼层
非常感谢亚瑟王!问题就是你所说的!
一定要细心的啊!
回复

使用道具 举报

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

本版积分规则

关闭

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

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

GMT+8, 2025-10-21 06:28 , Processed in 2.061017 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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