Hello£¬Qt——LinuxϱàдQt³ÌÐòµÄÏêϸ²½Öè
Ç°Ò»¶Îʱ¼ä×ö¹ýÒ»¸öÔÚLinuxϱàдµÄQt³ÌÐò£¬Ã»À´µÃ¼°×ܽᣬÏÖÔÚ×ܽáÒ»ÏÂLinuxÏ¿ª·¢µÄÏêϸ²½Öè¡£²»¹ýÏÖÔÚ·¢ÏÖʹÓÃEclipse»òÕßQt CreatorÒª±ÈÖ±½ÓÓÃVIM±à³Ì¿ì½Ý¶àÁË£¬ÒÔºóÔÚѧϰQtµÄ¹ý³ÌÖпÉÄܾͲ»Ö±½ÓÔÚLinuxϱàÁË£¬ÏÈÔÚWinxpϱàÁËÔÙÒÆÖ²°É¡£ ÈÎÎñ£ºÔÚRedhatϵͳÏ´´½¨ºÍÏÔʾһ¸ö¼òµ¥µÄ´°¿Ú£¬Ê¹ÓñêÇ©ÏÔʾ×Ö·û´®¡°Hello, Qt!¡±£¬ÔÚRedhatÉϵ÷ÊÔͨ¹ýºó½»²æ±àÒëÏÂÔØÖÁMagicARM2410ÉÏÔËÐС£ Ö÷Ҫ˼Ï룺±êÇ©ÊÇÉè¼ÆͼÐνçÃæ²»¿É»òȱµÄ»ù±¾×é¼þ£¬ÀûÓñêÇ©ÎÒÃÇ¿ÉÒÔÏÔʾ¸÷ÖÖÐÅÏ¢¡£QtΪ±êÇ©ÌṩÁËһϵÁÐAPIº¯Êý£¬Í¨¹ýµ÷ÓÃÕâЩº¯Êý£¬¿ÉÒÔºÜÈÝÒ×Éè¼Æ¸÷ÖÖ±êÇ©¡£µ÷ÓÃQtÖбêÇ©µÄAPIº¯Êý£¬±ØÐë°üº¬±êÇ©µÄÍ·Îļþqlabel.h¡£Èç¹ûÐèÒªÏÔʾµÄ×Ö·û´®ÐÅÏ¢ºÜ³¤£¬½¨Ò鲻ҪʹÓÃQLabel£¬¸ÄÓÃÆäËü²¿¼þÈçMultiLineedit£¨¶àÐбà¼Çø£©¡£ Ïêϸ²½Öè £¨1£©½øÈë/zylinux/x86-qtopiaĿ¼£¨Qt x86°²×°Ä¿Â¼£©£¬ÔËÐÐset-env½Å±¾£¬Îª±¾ÊµÑéÉèÖû·¾³±äÁ¿£¬È»ºó´´½¨Îļþ¼Ðhello¡£ 1: $ cd /zylinux/x86-qtopia
2:
3: $ . set-env
4:
5: $ mkdir hello
£¨2£©½øÈëhelloĿ¼£¬Ð½¨Îļþhello.cpp£¬²¢±àд³ÌÐò£¬È»ºóÓÃprogen¹¤¾ßÉú³É¹¤³ÌÎļþhello.pro¡£
1: $ cd hello
2:
3: $ vi hello.cpp
4:
5: $ progen –t app.t –o hello.pro
£¨3£©Ê¹ÓÃtmake¹¤¾ß£¬Éú³Éhello¹¤³ÌµÄMakefileÎļþ¡£
$ tmake -o Makefile hello.pro
£¨4£©ÐÞ¸ÄMakefileÎļþ£¬ÔÚLIBS±äÁ¿ÖÐÔö¼ÓÐèÒªÓõ½µÄ¿â£¬È»ºóÊäÈëmakeÃüÁî±àÒë¡£
1: LIBS = $(SUBLIBS) -L$(QTDIR)/lib -lqte -lm -lstdc++
$ make
£¨5£©Æô¶¯ÐéÄâ¿ØÖÆ̨£¬ÔËÐÐhello³ÌÐò£¨Ö÷»úÐëÆô¶¯Ö¡»º³å£¬±ØÐëÄܹ»·ÃÎÊ/dev/fb0£©¡£
1: $ cd /zylinux/x86-qtopia
2: qvfb&
3: $ cd hello
4:
5: $ ./hello –qws
»òÕßÔÚÖնˣ¬Æô¶¯ÐéÄ⻺³åÇøºÍQPE£¬Æô¶¯QtopiaµÄÖնˣ¬ÊäÈë./helloÔËÐгÌÐò£¬Òà¿ÉµÃµ½ºÍͼ 6.1Ò»ÑùµÄ½á¹û¡£
$ cd /zylinux/x86-qtopia
$ . set-env
$ cd hello
$ qvfb&
$ ./hello
$ qpe
Èç¹ûÒª½«Hello³ÌÐò·¢²¼µ½MagicARM2410ÉÏÔËÐУ¬»¹Ðè½øÐÐÒÔϹ¤
Ïà¹ØÎĵµ£º
1 ½ø³Ì¹ÜÀíÏà¹Ø´úÂë
1.1 thread_info½á¹¹£¬ÔÚÎļþ<asm/thread_info.h>Öж¨Òå
struct thread_info {
struct task_struct *task;
struct exec ......
1.ÔÚLinuxÆô¶¯½Å±¾ÖÐÖÆ×÷jffs2
2.ÔÚLinuxÖÕ¶ËÏÂÖÆ×÷jffs2
3.±¸×¢
1.ÔÚLinuxÆô¶¯½Å±¾ÖÐÖÆ×÷jffs2
¾ßÌå²Ù×÷²½Ö裺
sysinitÖÐ:
echo “Make jffs2 filesystem:”
erase /dev/mtd5
cd /tmp
echo “test” > test.txt
mkfs.jffs2 –d /tmp > /dev/mtdblock5
&nbs ......
ǶÈëʽLinux²Ù×÷ϵͳѧϰ¹æ»®
ARM+LINUX·Ïߣ¬Ö÷¹¥Ç¶ÈëʽLinux²Ù×÷ϵͳ¼°ÆäÉÏÓ¦ÓÃÈí¼þ¿ª·¢Ä¿±ê£º
£¨1£© ÕÆÎÕÖ÷Á÷ǶÈëʽ΢´¦ÀíÆ÷µÄ½á¹¹ÓëÔÀí£¨³õ²½¶¨Îªarm9£©
£¨2£© ±ØÐëÕÆÎÕÒ»¸öǶÈëʽ²Ù×÷ϵͳ £¨³õ²½¶¨Îªuclinux»òlinux,°æ±¾´ý¶¨£©
£¨3£© ±ØÐëÊìϤǶÈëʽÈí¼þ¿ª·¢Á÷³Ì² ......
Ò»°ãÔÚµ÷ÊÔ´òÓ¡DebugÐÅÏ¢µÄʱºò, ÐèÒª¿É±ä²ÎÊýµÄºê. ´ÓC99¿ªÊ¼¿ÉÒÔʹ±àÒëÆ÷±ê×¼Ö§³Ö¿É±ä²ÎÊýºê(variadic macros), ÁíÍâGCCÒ²Ö§³Ö¿É±ä²ÎÊýºê, µ«ÊÇÁ½ÖÖÔÚϸ½ÚÉÏ¿ÉÄÜ´æÔÚÇø±ð.
1. __VA_ARGS__
__VA_ARGS__ ½« "..." ´«µÝ¸øºê . Èç
......