? ËùÐè¾ß±¸µÄ±³¾°ÖªÊ¶
? ¿ª·¢ËùÐèµÄ»ù±¾»·¾³
? »ñµÃ°ïÖúµÄ;¾¶
? ͨ¹ýÒ»¸öʵÀýÁ˽â»ù±¾²½Öè
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
ssc ÓÚ 2007-01-06 11:52:19·¢±í:
лÁË
µÂÀï¿Ë ÓÚ 2007-01-05 15:52:06·¢±í:
:0)1 ÄܸüÏêϸµãÂð
jakepain ÓÚ 2007-01-05 11:29:40·¢±í:
ÂÛ̳ºÃ¶àÀíÂÛÐÔÎÄÕÂÎÒ¶¼²»¶®
ÀÏÐÖµÄÀý×ӺܺÃ
ÊʺϳõѧÕß
Emperor ÓÚ 2006-12-23 10:30:26·¢±í:
LinuxϵÄcÓïÑԺܺÃѽ
ljcheng200888 ÓÚ 2006-12-04 15:22:08·¢±í:
ÊÇ°¡£¬ºÇºÇ£¬ÎÒÒ²ÏëÂòÒ»±¾0»ù´¡µÄcÓïÑԽ̲ģ¬ÄÇλ¸ßÈËÄܸøÍƼöÒ»±¾°¡£¿
wjyongjiang ÓÚ 2006-12-04 00:18:41·¢±í:
fjdklsafij
weiweiwei21 ÓÚ 2006-12-03 19:49:10·¢±í:
¶¥
hylingzhi ÓÚ 2006-12-03 16:20:18·¢±í:
hao ding
72.232.206.* ÓÚ 2006-11-29 09:54:21·¢±í:
Good design!
http://wzukekab.com/zirv/pqiy.html | http://pybpkqcr.com/yauj/nfzu.html
72.36.178.* ÓÚ 2006-11-29 09:54:16·¢±í:
Thank you!
My homepage | Please visit
72.36.178.* ÓÚ 2006-11-29 09:54:12·¢±í:
Thank you!
My homepage | Cool site
spacesky ÓÚ 2006-11-28 15:11:20·¢±í:
:0L
ºÍÔÚWINDOWSÏÂÓкܴóÇø±ðµÄ°¡
resky ÓÚ 2006-11-27 18:24:55·¢±í:
ÉÏÈ¥
zouyyong782211 ÓÚ 2006-11-23 15:09:09·¢±í:
3k
lovefengzi ÓÚ 2006-11-21 11:24:47·¢±í:
thanks
guixiaolan ÓÚ 2006-11-18 15:03:25·¢±í:
Ò»¶Ñ²ÎÊý²»ÖªµÀÔõôÓÃ?
»¹²»ÈçÓÃTC
chunyu ÓÚ 2006-11-16 16:11:59·¢±í:
Ò»Ö±À§»óLinuxϱà³Ì£¬Ð»Ð»°¡
mail11758332 ÓÚ 2006-11-15 16:40:34·¢±í:
:0L
ColorÍà ÓÚ 2006-11-15 14:23:50·¢±í:
ѧϰÖÐ...
rainofwind ÓÚ 2006-11-09 11:44:19·¢±í:
:0L
wymam ÓÚ 2006-11-08 17:57:11·¢±í:
ÒÔÇ°ÔÚwindowsÏÂѧµÄ²»ÊǺܺ㬵«ÊDz»ÖªµÀÏÖÔÚÀ´Ñ§»á²»»á³ÙÁËÄØ£¡
ÓÚ 2006-11-06 05:48:34·¢±í:
ÎÒ¶¥£¬Ð´µÄÕæºÃ£¬Í¨Ë×Ò׶®£¬ÎÒ¸ÕÓÃlinux:0L
ÀîÒ» ÓÚ 2006-10-24 08:53:39·¢±í:
лл :0L
davidpike ÓÚ 2006-10-23 15:00:54·¢±í:
ÕýÏëÁ˽âÒ»ÏÂÕâ·½ÃæµÄ֪ʶÄØ£¡
hurt90 ÓÚ 2006-10-23 09:10:34·¢±í:
²»¹ý£¬ÎÒ¾õµÃ»¹ÊÇvim±à³Ì±È½ÏºÃ£¬ËäÈ»ÊÇÈ«×Ö·û½çÃ棬
open.wood ÓÚ 2006-10-22 20:59:27·¢±í:
¶¥
ÓÚ 2006-10-21 12:01:55·¢±í:
ºÃÎÄ
ly8683783 ÓÚ 2006-10-21 09:47:54·¢±í:
ÓÐûÓйØÓÚC¿âº¯ÊýµÄÊé°¡£¿£¿½éÉÜÒ»±¾Äå
jzlk ÓÚ 2006-10-19 15:08:11·¢±í:
xinlaoda ÓÚ 2006-10-16 15:58:56·¢±í:
ÏëѧÕâ·½ÃæµÄ֪ʶ,¿Éϧ»ù´¡±È½Ï²î,Äܲ»ÄÜÍƼöЩÊéÄØ?
yang1993 ÓÚ 2006-10-15 00:08:49·¢±í:
¶¥ÁË
2410linux ÓÚ 2006-10-13 18:24:40·¢±í:
hao
jamako ÓÚ 2006-09-28 09:58:59·¢±í:
²»´í£¬Ð»Ð»
°®ÎÞ½ûÑÔ ÓÚ 2006-09-27 12:57:37·¢±í:
°¥~~~~~~~С¶¥Ò»ÏÂ~~~~~~~!!!!!!!!!!!!!!
ǧֽº× ÓÚ 2006-09-27 10:19:32·¢±í:
ºÃ¶«Î÷
cailiao626 ÓÚ 2006-08-26 09:47:55·¢±í:
´ÓÁãÆð²½
»µ»µ´óÉÙ ÓÚ 2006-08-23 21:25:50·¢±í:
ÎÒ½ñÌì¸Õ×°ÁË LINUX ÏÖÔÚ¶ÔËü»¹Ê²Ã´¶¼²»¶® µ« C »¹ÊÇÁ˽âµÄ ¿´À´ÒªºÃºÃѧѧ LINUX ÁË
forfree ÓÚ 2006-08-22 10:33:18·¢±í:
²»¶¥²»ÐÐ
minny ÓÚ 2006-08-21 19:11:15·¢±í:
ÓÐÊÕ»ñ~
xiaomao2000 ÓÚ 2006-04-25 21:32:18·¢±í:
ÇóÖú:
ÎÒÊÇÒ»Ãû´óËÄѧÉú,±ÏÒµÉè¼ÆÊÇ×ö¹ØÓÚlinux²Ù×÷ϵͳ±à³Ì,µ«linux·½ÃæÎÒÊÇÃÅÍ⺺,¿ìÒª´ð±çÁËÉõÊÇ׿±,ÇóÖú¸÷λ¸ßÊÖ°ïæ,ÎÒÐèÒªÁ½¸ö¼òµ¥µÄ³ÌÐò1.»ùÓÚlinux²Ù×÷ϵͳµÄÄÚ´æ¹ÜÀíµÄʵÑéµÄ³ÌÐò2.»ùÓÚlinux²Ù×÷ϵͳÎļþϵͳ¹ÜÀíµÄʵÑéµÄ³ÌÐò. ÇëÇóÄÄλºÃÐĸßÊÖÄÜ°ï°ïÎÒ,ÓÐÏà¹Ø³ÌÐò·¢µç×ÓÓʼþ¸øÎÒ,³ÌÐòÔ½¼òµ¥Ô½ºÃ,×îºÃÄܰѳÌÐò·ÅÔÚwordÀ︽ÓгÌÐò˵Ã÷,¸Ð¼¤²»¾¡°¡!!!!!Îҵĵç×ÓÓʼþÊÇxiaomao19831202@126.com