? ËùÐè¾ß±¸µÄ±³¾°ÖªÊ¶
? ¿ª·¢ËùÐèµÄ»ù±¾»·¾³
? »ñµÃ°ïÖúµÄ;¾¶
? ͨ¹ýÒ»¸öʵÀýÁ˽â»ù±¾²½Öè
Prerequisite ÏȾöÌõ¼þ£º
ÔÚLinuxÉϱàд C ³ÌÐò£¬ÖÁÉÙÒªÊìϤÒÔÏÂÁ½·½ÃæµÄ»ù´¡ÖªÊ¶£º
1£® CÓïÑԵıà³Ì»ù´¡£¬ÖÁÉÙÒªÖªµÀһЩ»ù±¾µÄÓï·¨£¬¿ØÖÆÁ÷³ÌµÈ±à³Ì³£Ê¶¡£
¶Ô³£Óõıê×¼ C º¯Êý¿âÓг£Ê¶ÐÔµÄÁ˽⡣
2£® ¶ÔLinux/UNIX µÄ²Ù×÷Óг£Ê¶ÐÔµÄÁ˽⣬ÕÆÎÕ³£ÓõÄshell ÃüÁÈç ls, cat, cp, mkdir ¡etc.
Environment ËùÐè»·¾³:
1£® Linux/ Unix µÄ²Ù×÷ϵͳ£¬Ò²¿ÉÒÔʹÓÃwindowsϵÄcygwin¡£
ÎÒÃÇÕâÀïÌÖÂ۵Ķ¼ÊÇͨ¹ýshellÃüÁîÐнøÐвÙ×÷µÄ¡£ÄÇÈç¹û½øÈëÁËͼÐνçÃæµÄLinux Ôõô°ìÄØ£¿Ö»Òª´ò¿ªÒ»¸öÖÕ¶ËÃüÁ¾ÍºÍÃüÁîÐл·¾³ÍêÈ«Ò»ÑùÁË£¨´ò¿ª¿ªÊ¼²Ëµ¥¿ÉÒÔÕÒµ½ÖÕ¶ËÃüÁ¡£
2£® ±Ø±¸µÄ¿ª·¢¹¤¾ß£º
1) ÊäÈë³ÌÐòÐèÒªÒ»¸ö±à¼Æ÷¡£³£ÓõÄÓÐ vi , emacs. ÔÚÃüÁîÐÐÉÏÊäÈë vi, emacs, ¡ ¾Í¿É½øÈë±à¼»·¾³
¹ØÓÚ vi
¹ØÓÚ EMACS
2) CÓïÑԵıàÒëÆ÷¡£³£ÓõÄÊÇGNUµÄcÓïÑÔ±àÒëÆ÷ gcc(±àÒë C ³ÌÐò), g++(±àÒë C ++³ÌÐò)¡£
¹ØÓÚ gcc / g++
¹ØÓÚ makefile >>>> ÓÃÓÚ¼ò»¯±àÒë¹ý³Ì
ÕâÀïÓÐһƬÈëÃÅÎÄÕ LinuxÏÂCÓïÑÔ±à³Ì»ù´¡ÖªÊ¶£¬¿ÉÒÔÏÈ¿´Ò»ÏÂ
3) µ÷ÊÔ³ÌÐòµÄ³£Óù¤¾ß£ºgdb.
¹ØÓÚ gdb
Get help»ñµÃ°ïÖú£º
¹ØÓÚ Linux µÄÎĵµÊǷdz£·á¸»µÄ¡£×î¿ì½Ý£¬·½±ã£¬È«ÃæµÄ×ÊÁϾÍÔÚÄãµÄ»úÆ÷À²»ÒªÀË·Ñ¡£
ÔÚÃüÁîÐÐÉÏÊäÈëshellÃüÁî man »òÕß info£º
$man gcc >>>> Õâ¸öÃüÁî¿ÉÒÔ»ñµÃGNU µÄCÓïÑÔ±àÒëÆ÷µÄÎĵµ¡£µ±È»£¬ËûÃÇÊÇÓ¢Îĵġ£
¹ØÓÚ man
¹ØÓÚ info
ÍøÂçÉϵÄ×ÊÔ´Ò²ºÜ¶à£¬¶àµÃÒÔÖÁÓÚ²»ÖªµÀʲô²ÅÊÇ×Ô¼º×îÐèÒªµÄ¡£
¹ØÓÚÈçºÎ»ñµÃÓмÛÖµµÄÐÅÏ¢
¿´Ò»Ï loveunix ÉϵÄÏà¹Ø×ÊÔ´ >>>>
ÎÞË«²¹³äµÄһЩLinuxÏÂÈëÃűà³Ì×ÊÁÏ >>>>
¡¡
Basic steps »ù±¾²½Ö裺
1£® ÊäÈëÔ´´úÂë
2£® ±àÒ룬Á´½Ó£¬ÔËÐÐ
3£® µ÷ÊÔ³ÌÐò
ÎÒÃÇ´Ó×î»ù±¾µÄ hello world ³ÌÐò¿ªÊ¼£¬Êµ¼Ê²Ù×÷һϣº
1£® ÊäÈëÔ´´úÂë
ÒýÓÃ
$ emacs hello.c >>>> ½øÈëemacs ±à¼Æ÷»·¾³
#include
int main()
{
printf(¡°Hello World.\n¡±); >>>> Emacs»·¾³Ï£¬°´Ï Tab ¼ü£¬ÓÐ×Ô¶¯Ëõ½ø¹¦ÄÜ
exit(0);
}
Íê³ÉÊäÈëºó£¬°´×¡CTRL ¼ü£¬°´Ï x, ÔÙ°´Ï c , ×îºóËÉ¿ª CTRL¡£ >>>> ³ÌÐò±£Áô²¢Í˳öemacs »·¾³¡£
2£® ±àÒ룬Á´½Ó£¬ÔËÐÐ
ÒýÓÃ
$ gcc -o hello hello.c
$ ./hello >>>> ./ Ö¸Ã÷ÁËËùÖ´ÐгÌÐòµÄ·¾¶
Hello World.
$
Ò»¸ölinuxƽ̨ÉϵÄc³ÌÐò¿ª·¢ÒѾÍê³É¿©
3£® µ÷ÊÔ
Èç¹ûҪʹÓà gdb µ÷ÊÔ³ÌÐò£¬ÄÇôÔÚÉÏÒ»²½±àÒëµÄʱºò£¬¼ÇµÃ¼ÓÉÏ -g Ñ¡Ïî
ÒýÓÃ
$ gcc -g -o hello hello.c
$ gdb hello >>>> ½øÈë gdb µ÷ÊÔ»·¾³
¡¡
4. CVS°æ±¾¿ØÖÆÈí¼þ ---- Ðͬ¹¤×÷ºÍ±£Áô°æ±¾µÄ¹¤¾ß
¹ØÓÚ CVS
gonglx ÓÚ 2015-11-14 21:27:20·¢±í:
ÕæµÄºÜÓÐÓö¥¶¥
geekf ÓÚ 2015-11-09 17:19:07·¢±í:
(e:e2s
gudeng886 ÓÚ 2013-07-30 17:16:53·¢±í:
ÊÖ(6)m:b
zzwhjj ÓÚ 2013-07-30 13:40:19·¢±í:
Êé¼®ÔÚÄÄ¿ÉÒÔÏÂÔØ
chencong ÓÚ 2012-12-29 15:11:08·¢±í:
ºÃÌù£¬¶¥Ò»Ï£¡£¡£¡
guoyang0601 ÓÚ 2010-12-27 21:07:02·¢±í:
¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£
zfj0910 ÓÚ 2010-11-24 16:42:26·¢±í:
¿´²»µ½°¡
bingfengshuiye ÓÚ 2010-11-18 10:17:30·¢±í:
¶¥Â¥Ö÷
sclzwj ÓÚ 2010-10-27 12:22:14·¢±í:
´ó¼Ò¶¼¶¥ÁË£¬ÎÒÔõôÄܲ»¶¥ÄØ¡£
tjmzgn ÓÚ 2010-10-26 14:27:49·¢±í:
¾ÍÊÇ´ÓÕâ¸öʱºò¹ýÀ´µÄ£¡
ÃÞ°À¼Ó¶Ì¿ã ÓÚ 2010-09-25 20:41:32·¢±í:
[code][/code]
Â¥À¼ºóÖ÷ ÓÚ 2010-05-31 11:02:52·¢±í:
ÊÕÁË
haofree ÓÚ 2010-05-16 11:10:55·¢±í:
²»´í
flyaway ÓÚ 2010-05-12 16:20:53·¢±í:
лл¥Ö÷ÁË£¡
Ì«ÑôÖ®¹â ÓÚ 2010-05-10 12:03:00·¢±í:
ÓÐÒ»Ò»¶¨µÄÁ˽âÁË???лл·ÖÏí£¡
wolf_d ÓÚ 2010-04-23 15:45:32·¢±í:
ÊÕµ½£¬Ð»Ð»
¾²¾²·ÉÎè ÓÚ 2010-04-22 13:42:04·¢±í:
ÐÂÊÖ¿ÉÒÔ¿´¿´Å¶
835304205 ÓÚ 2010-04-22 09:53:57·¢±í:
лл¥Ö÷
ericq2010 ÓÚ 2010-04-22 09:45:08·¢±í:
cool................
sx-ljm ÓÚ 2010-04-22 07:13:34·¢±í:
ÊéµÄÏÂÔصØÖ·ÔÚÄÄÀ
tupac ÓÚ 2010-04-21 23:38:55·¢±í:
¶¥
bsszr ÓÚ 2010-03-13 22:09:42·¢±í:
ÔÞÒ»¸ö£¡
jackseaman ÓÚ 2010-03-13 20:24:13·¢±í:
good thinkings.
beautifularea ÓÚ 2010-03-12 23:23:12·¢±í:
ÓаïÖú
gudujianxfh ÓÚ 2010-03-08 14:28:17·¢±í:
Ö§³Ö£¡£¡£¡
qiuyengwo ÓÚ 2010-03-05 00:32:17·¢±í:
»¹ÒÔΪÊǸöµç×ÓÊé ллLZ
fanyq ÓÚ 2010-02-27 21:28:25·¢±í:
ͦ»ù´¡µÄ£¬Ð»Ð»lz
xiaoku8891 ÓÚ 2010-02-26 17:43:54·¢±í:
°ï¶¥Ï¡£¡£Ö§³Ö
ftp0000 ÓÚ 2010-01-28 14:21:02·¢±í:
¸Ðлlz·ÖÏí
leiyubingxin ÓÚ 2009-12-24 19:12:49·¢±í:
С¶¥Ò»ÏÂ
child7 ÓÚ 2009-12-20 18:32:30·¢±í:
ѧϰ£¬ÊÕ²ØÏÂ
uchiha ÓÚ 2009-12-19 17:24:36·¢±í:
¶¥¶¥
cshaoyan ÓÚ 2009-12-03 08:47:16·¢±í:
Õâ¸öȷʵ¹»³õ¼¶£¬Ð»Ð»
Reachie ÓÚ 2009-12-02 15:45:26·¢±í:
up
erathia ÓÚ 2009-12-01 14:43:55·¢±í:
UP
lly20021228 ÓÚ 2009-11-30 23:54:47·¢±í:
ÐÁ¿àÀ²
huwei025 ÓÚ 2009-11-26 21:48:49·¢±í:
лл·ÖÏíлл·ÖÏí
550804556 ÓÚ 2009-11-25 15:02:09·¢±í:
¶¥¶¥¶¥
550804556 ÓÚ 2009-11-25 15:02:03·¢±í:
¶¥¶¥¶¥¶¥
550804556 ÓÚ 2009-11-25 15:01:59·¢±í:
¶¥¶¥¶¥¶¥