ºìÁªLinuxÃÅ»§
Linux°ïÖú

Qt±àÒë³ö´í£¬Çóǰ±²Ãǰïæ½â´ð

·¢²¼Ê±¼ä:2009-12-03 23:10:09À´Ô´:ºìÁª×÷Õß:chentao0919
[i=s] ±¾Ìû×îºóÓÉ chentao0919 ÓÚ 2009-12-4 19:25 ±à¼­ [/i]

°²×°ºÃÁË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();
}
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 5 ÌõÆÀÂÛ

  1. linshao.Solin ÓÚ 2010-01-08 13:32:25·¢±í:

    #include
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    **********
    return a.exec();
    }
    ÕâЩÊÇ×î»ù±¾µÄ´úÂë

  2. linshao.Solin ÓÚ 2010-01-08 13:31:01·¢±í:

    ÔÚLinuxÏ£¬ÄãÕâ¸öÊÇȱÉÙÁ½¸öÎļþµÄ°É£¬×îºÃжµô£¬È»ºóÔÙ×°£¬ÕâÊÇûװÍêÕûµÄÑù×Ó£¬×îаæµÃ³öÀ´ÁË£¬ºÃÓÃRPM°ü×°°É

  3. chentao0919 ÓÚ 2009-12-04 19:25:42·¢±í:

    3# 396886380


    ¶¼¼ÓÁ˰¡£¬³ÌÐò¾ÍÊÇÉÏÃæµÄÄǸö£¬

  4. 396886380 ÓÚ 2009-12-04 19:21:50·¢±í:

    ÄãÊDz»Êǵ÷ÓÃÁËʲôº¯Êý£¿

    Ïà¹ØµÄÍ·Îļþ¼ÓÁËû£¿

    ÓÃmake ²»ÐУ¬Äã¾ÍÖ±½ÓÓÃgcc±à¼­ÊÔÊÔ¿´¡£

    ¿ÉÒÔ°ÑÄã¾ßÌåµÄ³ÌÐòÌù³öÀ´¡£

  5. 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)