晕。看了这个版的帖子,才发现原来楼主已经把arm上的写出来了。唉。感谢了。
楼主,我遇到新的问题,我发现我自己写了一个helloworld.结果按照您的简便方法
#qmake -project
后。文件夹里面出现了2个.pro文件,一个以我的文件夹命名,一个以我的C文件命名。
然后我就把2个pro文件后面都加上了TARGET
然后copy他自带的hello的build过来,然后 ./build。
以外的出现很多错误
../qtopia-2.2.0-FriendlyARM/qt2/include/qpixmap.h:254: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QPixmap’
../qtopia-2.2.0-FriendlyARM/qt2/include/qpixmap.h:266: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
../qtopia-2.2.0-FriendlyARM/qt2/include/qpixmap.h:271: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
../qtopia-2.2.0-FriendlyARM/qt2/include/qpixmap.h:276: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QPixmap’
../qtopia-2.2.0-FriendlyARM/qt2/include/qpixmap.h:294: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
../qtopia-2.2.0-FriendlyARM/qt2/include/qpixmap.h:295: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
In file included from ../qtopia-2.2.0-FriendlyARM/qt2/include/qpushbutton.h:43,
from test.c:2:
../qtopia-2.2.0-FriendlyARM/qt2/include/qiconset.h:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QIconSet’
In file included from test.c:2:
../qtopia-2.2.0-FriendlyARM/qt2/include/qpushbutton.h:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QPushButton’
test.c: In function ‘main’:
test.c:6: error: ‘QApplication’ undeclared (first use in this function)
test.c:6: error: (Each undeclared identifier is reported only once
test.c:6: error: for each function it appears in.)
test.c:6: error: expected ‘;’ before ‘a’
test.c:7: error: ‘QPushButton’ undeclared (first use in this function)
test.c:7: error: expected ‘;’ before ‘hellobtn’
test.c:8: error: ‘hellobtn’ undeclared (first use in this function)
test.c:9: error: ‘a’ undeclared (first use in this function)
test.c:4: warning: unused parameter ‘argc’
test.c:4: warning: unused parameter ‘argv’
make: *** [.obj/release-shared/test.o] Error 1
这个只是部分。
我的C文件如下
1 #include <qapplication.h>
2 #include <qpushbutton.h>
3
4 int main(int argc, char **argv)
5 {
6 QApplication a(argc, argv);
7 QPushButton hellobtn("Hello QT",0);
8 hellobtn.resize(100, 20);
9 a.setMainWidget(&hellobtn);
10 hellobtn.show();
11 return a.exec();
12 }
我估计也是环境变量的问题。的开发板是micro2440.
x86-qtopia正常安装。