°²×°ºÃÁËqt-x11£¬ÏÖÔÚ±àÒëhello³ÌÐòmakeÀÏÊdzö´í
¾ÍÊÇ˵£º
QApplication£ºÃ»ÓÐÄǸöÎļþ»òĿ¼
QLable£ºÃ»ÓÐÄǸöÎļþ»òĿ¼
¡¡
¡¡
ÕâÊÇʲôÔÒò°¡£¬Ò²ÔÚÍøÉÏÕÒ¹ýÏà¹ØµÄ£¬Ê²Ã´»·¾³±äÁ¿µÄÉèÖÃÖ®ÀàµÄ£¬°´ÕÕËûÃÇ˵µÄ¸ÄÁ˶¼Ã»ÓÐÓã¬
Âé·³ÎÊÏÂǰ±²ÃÇÕâÊÇʲôÔÒòÄØ£¿
#include
#include
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
linshao.Solin ÓÚ 2010-01-08 13:32:25·¢±í:
#include
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
**********
return a.exec();
}
ÕâЩÊÇ×î»ù±¾µÄ´úÂë
linshao.Solin ÓÚ 2010-01-08 13:31:01·¢±í:
ÔÚLinuxÏ£¬ÄãÕâ¸öÊÇȱÉÙÁ½¸öÎļþµÄ°É£¬×îºÃжµô£¬È»ºóÔÙ×°£¬ÕâÊÇûװÍêÕûµÄÑù×Ó£¬×îаæµÃ³öÀ´ÁË£¬ºÃÓÃRPM°ü×°°É
chentao0919 ÓÚ 2009-12-04 19:25:42·¢±í:
3# 396886380
¶¼¼ÓÁ˰¡£¬³ÌÐò¾ÍÊÇÉÏÃæµÄÄǸö£¬
396886380 ÓÚ 2009-12-04 19:21:50·¢±í:
ÄãÊDz»Êǵ÷ÓÃÁËʲôº¯Êý£¿
Ïà¹ØµÄÍ·Îļþ¼ÓÁËû£¿
ÓÃmake ²»ÐУ¬Äã¾ÍÖ±½ÓÓÃgcc±à¼ÊÔÊÔ¿´¡£
¿ÉÒÔ°ÑÄã¾ßÌåµÄ³ÌÐòÌù³öÀ´¡£
chentao0919 ÓÚ 2009-12-04 19:18:17·¢±í:
¾ßÌå´íÎóÊÇÕâÑù×ӵģº
helloworld.cpp:1:23: qapplication.h: No such file or directory
helloworld.cpp:1:17: qlabel.h: No such file or directory
helloworld.cpp: In function 'int main(int,char**)':
helloworld.cpp:6: 'Qapplication' undeclared(first use this function)
helloworld.cpp:6: (Each undeclared identifier is reported only once for each function it appears in.)
helloworld.cpp:6: parse error before '(' token
helloworld.cpp:7: 'Qlabel' undeclared (first use this function)
helloworld.cpp:8: 'hello' undeclared (first use this function)
helloworld.cpp:9: 'app' undeclared (first use this function)