|
Lines 23-116
Link Here
|
| 23 |
<title>µ{¦¡¶}µo¤u¨ã</title> |
23 |
<title>µ{¦¡¶}µo¤u¨ã</title> |
| 24 |
<sect1 id="tools-synopsis"><title>·§±Ô</title> |
24 |
<sect1 id="tools-synopsis"><title>·§±Ô</title> |
| 25 |
|
25 |
|
| 26 |
<para> |
26 |
<para>¥»³¹±N¤¶²Ð¦p¦ó¨Ï¥Î¤@¨Ç FreeBSD ©Ò´£¨Ñªºµ{¦¡¶}µo¤u¨ã(programing tools)¡A |
| 27 |
¥»³¹±N¤¶²Ð¦p¦ó¨Ï¥Î¤@¨Ç FreeBSD ©Ò´£¨Ñªºµ{¦¡¶}µo¤u¨ã(programing tools)¡A |
|
|
| 28 |
¥»³¹©Ò¤¶²Ðªº¤u¨ãµ{¦¡¦b¨ä¥Lª©¥»ªº &unix; ¤W¤]¥i¨Ï¥Î¡A |
27 |
¥»³¹©Ò¤¶²Ðªº¤u¨ãµ{¦¡¦b¨ä¥Lª©¥»ªº &unix; ¤W¤]¥i¨Ï¥Î¡A |
| 29 |
¦b¦¹ <emphasis>¨Ã¤£·|</emphasis> ¹Á¸Õ´yz¼gµ{¦¡®Éªº¨CÓ²Ó¸`¡A |
28 |
¦b¦¹ <emphasis>¨Ã¤£·|</emphasis> ¹Á¸Õ´yz¼gµ{¦¡®Éªº¨CÓ²Ó¸`¡A |
| 30 |
¥»³¹¤j³¡¤À½g´T³£¬O°²³]§A¥H«e¨S¦³©Î¥u¦³¤Ö¼Æªº¼gµ{¦¡¸gÅç¡A |
29 |
¥»³¹¤j³¡¤À½g´T³£¬O°²³]§A¥H«e¨S¦³©Î¥u¦³¤Ö¼Æªº¼gµ{¦¡¸gÅç¡A |
| 31 |
¤£¹L¡AÁÙ¬O§Æ±æ¤j¦h¼Æªºµ{¦¡¶}µo¤Hû³£¯à±q¤¤«·s±o¨ì¤@¨Ç±Òµo¡C |
30 |
¤£¹L¡AÁÙ¬O§Æ±æ¤j¦h¼Æªºµ{¦¡¶}µo¤Hû³£¯à±q¤¤«·s±o¨ì¤@¨Ç±Òµo¡C</para> |
| 32 |
</para> |
|
|
| 33 |
|
31 |
|
| 34 |
</sect1> |
32 |
</sect1> |
| 35 |
|
33 |
|
| 36 |
<sect1 id="tools-intro"><title>²¤¶</title> |
34 |
<sect1 id="tools-intro"><title>²¤¶</title> |
| 37 |
|
35 |
|
| 38 |
<para> |
36 |
<para>FreeBSD ´£¨Ñ¤@Ó«D±`´Îªº¶}µoÀô¹Ò¡A |
| 39 |
FreeBSD ´£¨Ñ¤@Ó«D±`´Îªº¶}µoÀô¹Ò¡A |
|
|
| 40 |
¤ñ¦p»¡¹³¬O C¡BC++¡BFortran ©M assembler(²Õ¦X»y¨¥)ªº½s;¹(compiler), |
37 |
¤ñ¦p»¡¹³¬O C¡BC++¡BFortran ©M assembler(²Õ¦X»y¨¥)ªº½s;¹(compiler), |
| 41 |
¦b FreeBSD ¤¤³£¤w¸g¥]§t¦b°ò¥»ªº¨t²Î¤¤¤F |
38 |
¦b FreeBSD ¤¤³£¤w¸g¥]§t¦b°ò¥»ªº¨t²Î¤¤¤F |
| 42 |
§ó§O´£ Perl ©M¨ä¥L¼Ð·Ç &unix; ¤u¨ã¡A¹³¬O<command>sed</command> ¥H¤Î <command>awk</command>¡A |
39 |
§ó§O´£ Perl ©M¨ä¥L¼Ð·Ç &unix; ¤u¨ã¡A¹³¬O<command>sed</command> ¥H¤Î <command>awk</command>¡A |
| 43 |
¦pªG§AÁÙ¬Oı±o¤£°÷¡AFreeBSD¦b Ports collection ¤¤ÁÙ´£¨Ñ¨ä¥Lªº½s;¹©Mª½Ä¶¾¹(interpreter), |
40 |
¦pªG§AÁÙ¬Oı±o¤£°÷¡AFreeBSD¦b Ports collection ¤¤ÁÙ´£¨Ñ¨ä¥Lªº½s;¹©Mª½Ä¶¾¹(interpreter), |
| 44 |
FreeBSD ¬Û®e³\¦h¼Ð·Ç¡A¹³¬O <acronym>&posix;</acronym> ©M <acronym>ANSI</acronym> C¡A |
41 |
FreeBSD ¬Û®e³\¦h¼Ð·Ç¡A¹³¬O <acronym>&posix;</acronym> ©M <acronym>ANSI</acronym> C¡A |
| 45 |
·íµMÁÙ¦³¥¦©ÒÄ~©Óªº BSD ¶Ç²Î¡C |
42 |
·íµMÁÙ¦³¥¦©ÒÄ~©Óªº BSD ¶Ç²Î¡C |
| 46 |
©Ò¥H¦b FreeBSD ¤W¼gªºµ{¦¡¤£»Ý×§ï©Î³»¦hµy·L×§ï¡A´N¥i¥H¦b³\¦h¥¥x¤W½sĶ¡B°õ¦æ¡C |
43 |
©Ò¥H¦b FreeBSD ¤W¼gªºµ{¦¡¤£»Ý×§ï©Î³»¦hµy·L×§ï¡A´N¥i¥H¦b³\¦h¥¥x¤W½sĶ¡B°õ¦æ¡C</para> |
| 47 |
</para> |
|
|
| 48 |
|
44 |
|
| 49 |
<para> |
45 |
<para>µL½×¦p¦ó¡A´Nºâ§A±q¨Ó¨S¦b &unix; ¥¥x¤W¼g¹Lµ{¦¡¡A¤]¥i¥H¹ý©³·P¨ü¨ìFreeBSD ¥O¤HµLªk§Ü©Úªº°g¤HÅ]¤O¡C |
| 50 |
µL½×¦p¦ó¡A´Nºâ§A±q¨Ó¨S¦b &unix; ¥¥x¤W¼g¹Lµ{¦¡¡A¤]¥i¥H¹ý©³·P¨ü¨ìFreeBSD ¥O¤HµLªk§Ü©Úªº°g¤HÅ]¤O¡C |
|
|
| 51 |
¥»³¹ªº¥Ø¼Ð´N¬O¨ó§U§A§Ö³t¤W¤â¡A¦Ó¼È®É¤£»Ý²`¤J¤Ó¦h¶i¶¥¥DÃD¡A |
46 |
¥»³¹ªº¥Ø¼Ð´N¬O¨ó§U§A§Ö³t¤W¤â¡A¦Ó¼È®É¤£»Ý²`¤J¤Ó¦h¶i¶¥¥DÃD¡A |
| 52 |
¨Ã¥BÁ¿¸Ñ¤@¨Ç°ò¦·§©À¡A¥HÅý§A¥i¥HÁA¸Ñ§Ú̦bÁ¿¨Ç¤°»ò¡C |
47 |
¨Ã¥BÁ¿¸Ñ¤@¨Ç°ò¦·§©À¡A¥HÅý§A¥i¥HÁA¸Ñ§Ú̦bÁ¿¨Ç¤°»ò¡C</para> |
| 53 |
</para> |
|
|
| 54 |
|
48 |
|
| 55 |
<para> |
49 |
<para>¥»³¹¤º®e¨Ã¤£n¨D§A±o¦³µ{¦¡¶}µo¸gÅç¡A©ÎªÌ§A¥u¦³¤@ÂIÂIªº¸gÅç¦Ó¤w¡C |
| 56 |
¥»³¹¤º®e¨Ã¤£n¨D§A±o¦³µ{¦¡¶}µo¸gÅç¡A©ÎªÌ§A¥u¦³¤@ÂIÂIªº¸gÅç¦Ó¤w¡C |
|
|
| 57 |
¤£¹L¡A§Ṵ́²³]§A¤w¸g·| &unix; ¨t²Îªº°ò¥»¾Þ§@¡A |
50 |
¤£¹L¡A§Ṵ́²³]§A¤w¸g·| &unix; ¨t²Îªº°ò¥»¾Þ§@¡A |
| 58 |
¦Ó¥B§ó«nªº¬O¡A½Ð«O«ù¼Ö©ó¾Ç²ßªº¤ßºA¡I |
51 |
¦Ó¥B§ó«nªº¬O¡A½Ð«O«ù¼Ö©ó¾Ç²ßªº¤ßºA¡I</para> |
| 59 |
</para> |
|
|
| 60 |
|
52 |
|
| 61 |
</sect1> |
53 |
</sect1> |
| 62 |
|
54 |
|
| 63 |
<sect1 id="tools-programming"> |
55 |
<sect1 id="tools-programming"> |
| 64 |
<title>Programming ·§©À</title> |
56 |
<title>Programming ·§©À</title> |
| 65 |
|
57 |
|
| 66 |
<para> |
58 |
<para>²³æªº»¡¡Aµ{¦¡¥u¬O¤@°ï«ü¥Oªº¶°¦XÅé¡F¦Ó³o¨Ç«ü¥O¬O¥Î¨Ó§i¶D¹q¸£À³¸Ón§@¨º¨Ç¨Æ±¡¡C |
| 67 |
²³æªº»¡¡Aµ{¦¡¥u¬O¤@°ï«ü¥Oªº¶°¦XÅé¡F¦Ó³o¨Ç«ü¥O¬O¥Î¨Ó§i¶D¹q¸£À³¸Ón§@¨º¨Ç¨Æ±¡¡C |
|
|
| 68 |
¦³®ÉÔ¡A«ü¥Oªº°õ¦æ¨ú¨M©ó«e¤@Ó«ü¥Oªºµ²ªG¦Ó©w¡C |
59 |
¦³®ÉÔ¡A«ü¥Oªº°õ¦æ¨ú¨M©ó«e¤@Ó«ü¥Oªºµ²ªG¦Ó©w¡C |
| 69 |
¥»³¹±N·|§i¶D§A¦³ 2 Ó¥Dnªº¤èªk¡AÅý§A¥i¥H¹ï¹q¸£¤U¹F³o¨Ç«ü¥Ü(instruction) ©Î <quote>©R¥O(commands)</quote>¡C |
60 |
¥»³¹±N·|§i¶D§A¦³ 2 Ó¥Dnªº¤èªk¡AÅý§A¥i¥H¹ï¹q¸£¤U¹F³o¨Ç«ü¥Ü(instruction) ©Î <quote>©R¥O(commands)</quote>¡C |
| 70 |
²Ä¤@Ó¤èªk´N¬O <firstterm>ª½Ä¶¾¹(interpreter)</firstterm>¡A |
61 |
²Ä¤@Ó¤èªk´N¬O <firstterm>ª½Ä¶¾¹(interpreter)</firstterm>¡A |
| 71 |
¦Ó²Ä¤GÓ¤èªk¬O <firstterm>½s;¹(compiler)</firstterm>¡C |
62 |
¦Ó²Ä¤GÓ¤èªk¬O <firstterm>½s;¹(compiler)</firstterm>¡C |
| 72 |
¥Ñ©ó¹ï©ó¹q¸£¦Ó¨¥¡A¤HÃþ»y¨¥ªº»y·N¹L©ó¼Ò½k¦Ó¤ÓÃø²z¸Ñ¡A |
63 |
¥Ñ©ó¹ï©ó¹q¸£¦Ó¨¥¡A¤HÃþ»y¨¥ªº»y·N¹L©ó¼Ò½k¦Ó¤ÓÃø²z¸Ñ¡A |
| 73 |
¦]¦¹©R¥O(commands)´N±`·|¥H¤@ºØ(©Î¦hºØ)µ{¦¡»y¨¥¼g¦¨¡A¥Î¨Ó«ü¥Ü¹q¸£©Òn°õ¦æªº¯S©w°Ê§@¬°¦ó¡C |
64 |
¦]¦¹©R¥O(commands)´N±`·|¥H¤@ºØ(©Î¦hºØ)µ{¦¡»y¨¥¼g¦¨¡A¥Î¨Ó«ü¥Ü¹q¸£©Òn°õ¦æªº¯S©w°Ê§@¬°¦ó¡C</para> |
| 74 |
</para> |
|
|
| 75 |
|
65 |
|
| 76 |
<sect2> |
66 |
<sect2> |
| 77 |
<title>ª½Ä¶¾¹</title> |
67 |
<title>ª½Ä¶¾¹</title> |
| 78 |
|
68 |
|
| 79 |
<para> |
69 |
<para>¨Ï¥Îª½Ä¶¾¹®É¡A©Ò¨Ï¥Îªºµ{¦¡»y¨¥´N¹³Åܦ¨¤@Ó·|©M§A¤¬°ÊªºÀô¹Ò¡C |
| 80 |
¨Ï¥Îª½Ä¶¾¹®É¡A©Ò¨Ï¥Îªºµ{¦¡»y¨¥´N¹³Åܦ¨¤@Ó·|©M§A¤¬°ÊªºÀô¹Ò¡C |
|
|
| 81 |
·í¦b©R¥O´£¥Ü¦C¤W¥´¤W©R¥O®É¡Aª½Ä¶¾¹·|§Y®É°õ¦æ¸Ó©R¥O¡C |
70 |
·í¦b©R¥O´£¥Ü¦C¤W¥´¤W©R¥O®É¡Aª½Ä¶¾¹·|§Y®É°õ¦æ¸Ó©R¥O¡C |
| 82 |
¦b¤ñ¸û½ÆÂøªºµ{¦¡¤¤¡A¥i¥H§â©Ò¦³·Q¤U¹Fªº©R¥O²Î²Î¿é¤J¨ì¬YÀɮ׸̱¥h¡A |
71 |
¦b¤ñ¸û½ÆÂøªºµ{¦¡¤¤¡A¥i¥H§â©Ò¦³·Q¤U¹Fªº©R¥O²Î²Î¿é¤J¨ì¬YÀɮ׸̱¥h¡A |
| 83 |
µM«á©I¥sª½Ä¶¾¹¥hŪ¨ú¸ÓÀɮסA¨Ã¥B°õ¦æ§A¼g¦b³oÓÀɮפ¤ªº«ü¥O¡C |
72 |
µM«á©I¥sª½Ä¶¾¹¥hŪ¨ú¸ÓÀɮסA¨Ã¥B°õ¦æ§A¼g¦b³oÓÀɮפ¤ªº«ü¥O¡C |
| 84 |
¦pªG©Ò¤Uªº«ü¥O¦³¿ù»~²£¥Í¡A¤j¦h¼Æªºª½Ä¶¾¹·|¶i¤J°»¿ù¼Ò¦¡(debugger)¡A |
73 |
¦pªG©Ò¤Uªº«ü¥O¦³¿ù»~²£¥Í¡A¤j¦h¼Æªºª½Ä¶¾¹·|¶i¤J°»¿ù¼Ò¦¡(debugger)¡A |
| 85 |
¨Ã¥BÅã¥Ü¬ÛÃö¿ù»~°T®§¡A¥H«K¹ïµ{¦¡°£¿ù¡C |
74 |
¨Ã¥BÅã¥Ü¬ÛÃö¿ù»~°T®§¡A¥H«K¹ïµ{¦¡°£¿ù¡C</para> |
| 86 |
</para> |
|
|
| 87 |
|
75 |
|
| 88 |
<para> |
76 |
<para>³oºØ¤è¦¡¦n³B¦b©ó¡G¥i¥H¥ß¨è¬Ý¨ì«ü¥Oªº°õ¦æµ²ªG¡A¥H¤Î¿ù»~¤]¥i¨³³t×¥¿¡C |
| 89 |
³oºØ¤è¦¡¦n³B¦b©ó¡G¥i¥H¥ß¨è¬Ý¨ì«ü¥Oªº°õ¦æµ²ªG¡A¥H¤Î¿ù»~¤]¥i¨³³t×¥¿¡C |
77 |
¬Û¹ïªº¡A³Ì¤jªºÃa³B«K¬O·í§A·Q§â§A¼gªºµ{¦¡¤À¨Éµ¹¨ä¥L¤H®É¡A³o¨Ç¤H¥²¶·n¦³¸ò§A¤@¼Ëªºª½Ä¶¾¹¡C |
| 90 |
¬Û¹ïªº¡A³Ì¤jªºÃa³B«K¬O·í§A·Q§â§A¼gªºµ{¦¡¤À¨Éµ¹¨ä¥L¤H®É¡A³o¨Ç¤H¥²¶·n¦³¸ò§A¤@¼Ëªºª½Ä¶¾¹¡C |
78 |
¦Ó¥B§O§Ñ¤F¡A¥L̤]n·|¨Ï¥Îª½Ä¶¾¹ª½Ä¶µ{¦¡¤~¦æ¡C |
| 91 |
¦Ó¥B§O§Ñ¤F¡A¥L̤]n·|¨Ï¥Îª½Ä¶¾¹ª½Ä¶µ{¦¡¤~¦æ¡C |
79 |
·íµM¨Ï¥ÎªÌ¤]¤£§Æ±æ¤£¤p¤ß«ö¿ùÁä¡A´N¶i¤J°»¿ù¼Ò¦¡¦Ó¤£ª¾©Ò±¹¡C |
| 92 |
·íµM¨Ï¥ÎªÌ¤]¤£§Æ±æ¤£¤p¤ß«ö¿ùÁä¡A´N¶i¤J°»¿ù¼Ò¦¡¦Ó¤£ª¾©Ò±¹¡C |
80 |
´N°õ¦æ®Ä²v¦Ó¨¥¡Aª½Ä¶¾¹·|¨Ï¥Î¨ì«Ü¦hªº°O¾ÐÅé¡A |
| 93 |
´N°õ¦æ®Ä²v¦Ó¨¥¡Aª½Ä¶¾¹·|¨Ï¥Î¨ì«Ü¦hªº°O¾ÐÅé¡A |
81 |
¦Ó¥B³oÃþª½Ä¶¦¡µ{¦¡¡A³q±`¨Ã¤£·|¤ñ½s;¹©Ò½sĶªºµ{¦¡ªº§ó¦³®Ä²v¡C</para> |
| 94 |
¦Ó¥B³oÃþª½Ä¶¦¡µ{¦¡¡A³q±`¨Ã¤£·|¤ñ½s;¹©Ò½sĶªºµ{¦¡ªº§ó¦³®Ä²v¡C |
82 |
|
| 95 |
</para> |
83 |
<para>µ§ªÌÓ¤H»{¬°¡A¦pªG§A¤§«e¨S¦³¾Ç¹L¥ô¦óµ{¦¡»y¨¥¡A³Ì¦n¥ý¾Ç¾Ç²ßª½Ä¶¦¡»y¨¥(interpreted languages)¡A |
| 96 |
|
84 |
¹³¬O Lisp¡ASmalltalk¡APerl ©M Basic ³£¬O¡A&unix; ªº shell ¹³¬O <command>sh</command> ©M <command>csh</command> |
| 97 |
<para> |
85 |
¥¦Ì¥»¨´N¬Oª½Ä¶¾¹¡A¨Æ¹ê¤W¡A«Ü¦h¤H³£¦b¥¦Ì¦Û¤v¾÷¾¹¤W¼¶¼g¦U¦¡ªº shell <quote>script</quote>¡A |
| 98 |
µ§ªÌÓ¤H»{¬°¡A¦pªG§A¤§«e¨S¦³¾Ç¹L¥ô¦óµ{¦¡»y¨¥¡A³Ì¦n¥ý¾Ç¾Ç²ßª½Ä¶¦¡»y¨¥(interpreted languages)¡A |
86 |
¨Ó¶¶§Q§¹¦¨¦U¶µ <quote>housekeeping(ºûÅ@)</quote> ¥ô°È¡C |
| 99 |
¹³¬O Lisp¡ASmalltalk¡APerl ©M Basic ³£¬O¡A&unix; ªº shell ¹³¬O <command>sh</command> ©M <command>csh</command> |
87 |
&unix; ªº¨Ï¥Îõ¾Ç¤§¤@´N¬O´£¨Ñ¤j¶qªº¤p¤u¨ã¡A |
| 100 |
¥¦Ì¥»¨´N¬Oª½Ä¶¾¹¡A¨Æ¹ê¤W¡A«Ü¦h¤H³£¦b¥¦Ì¦Û¤v¾÷¾¹¤W¼¶¼g¦U¦¡ªº shell <quote>script</quote>¡A |
88 |
¨Ã¨Ï¥Î shell script ¨Ó²Õ¦X¹B¥Î³o¨Ç¤p¤u¨ã¡A¥H«K¤u§@§ó¦³®Ä²v¡C</para> |
| 101 |
¨Ó¶¶§Q§¹¦¨¦U¶µ <quote>housekeeping(ºûÅ@)</quote> ¥ô°È¡C |
|
|
| 102 |
&unix; ¨Ï¥Îõ¾Ç¤§¤@´N¬O´£¨Ñ¤j¶qªº¤p¤u¨ã¡A |
| 103 |
¨Ã¨Ï¥Î shell script ¨Ó²Õ¦X¹B¥Î³o¨Ç¤p¤u¨ã¡A¥H«K¤u§@§ó¦³®Ä²v¡C |
| 104 |
</sect2> |
89 |
</sect2> |
| 105 |
|
90 |
|
| 106 |
<sect2> |
91 |
<sect2> |
| 107 |
<title>FreeBSD ´£¨Ñªºª½Ä¶¾¹</title> |
92 |
<title>FreeBSD ´£¨Ñªºª½Ä¶¾¹</title> |
| 108 |
|
93 |
|
| 109 |
<para> |
94 |
<para>¤U±³oÃ䦳¥÷ &os; Ports Collection ©Ò´£¨Ñªºª½Ä¶¾¹²M³æ¡AÁÙ¦³°Q½×¤@¨Ç¤ñ¸û¨üÅwªïªºª½Ä¶¦¡»y¨¥</para> |
| 110 |
¤U±³oÃ䦳¥÷ &os; Ports Collection ©Ò´£¨Ñªºª½Ä¶¾¹²M³æ¡AÁÙ¦³°Q½×¤@¨Ç¤ñ¸û¨üÅwªïªºª½Ä¶¦¡»y¨¥</para> |
|
|
| 111 |
|
95 |
|
| 112 |
<para> |
96 |
<para>¦Ü©ó¦p¦ó¨Ï¥Î Ports Collection ¦w¸Ëªº»¡©ú¡A¥i°Ñ¾\ FreeBSD Handbook ¤¤ªº |
| 113 |
¦Ü©ó¦p¦ó¨Ï¥Î Ports Collection ¦w¸Ëªº»¡©ú¡A¥i°Ñ¾\ FreeBSD Handbook ¤¤ªº |
|
|
| 114 |
<ulink url="&url.books.handbook;/ports-using.html">Ports³¹¸`</ulink>¡C |
97 |
<ulink url="&url.books.handbook;/ports-using.html">Ports³¹¸`</ulink>¡C |
| 115 |
<variablelist> |
98 |
<variablelist> |
| 116 |
<varlistentry> |
99 |
<varlistentry> |
|
Lines 146-153
Link Here
|
| 146 |
¡A¦¹¥~ CMUCL(¥]§t¤@Ó¤w¸g³Ì¨Î¤Æªº½s;¹)¡A |
129 |
¡A¦¹¥~ CMUCL(¥]§t¤@Ó¤w¸g³Ì¨Î¤Æªº½s;¹)¡A |
| 147 |
¥H¤Î¨ä¥L²¤Æª©ªº LISP ª½Ä¶¾¹(¤ñ¦p¥H C »y¨¥¼gªº SLisp¡A¥u¥Î´X¦Ê¦æµ{¦¡½X´N¹ê§@¤j¦h¼Æ Common Lisp ªº¥\¯à) |
130 |
¥H¤Î¨ä¥L²¤Æª©ªº LISP ª½Ä¶¾¹(¤ñ¦p¥H C »y¨¥¼gªº SLisp¡A¥u¥Î´X¦Ê¦æµ{¦¡½X´N¹ê§@¤j¦h¼Æ Common Lisp ªº¥\¯à) |
| 148 |
«h¬O¤À§O¦¬¿ý¦b <filename role="package">lang/cmucl</filename> ¥H¤Î |
131 |
«h¬O¤À§O¦¬¿ý¦b <filename role="package">lang/cmucl</filename> ¥H¤Î |
| 149 |
<filename role="package">lang/slisp</filename>¡C |
132 |
<filename role="package">lang/slisp</filename>¡C</para> |
| 150 |
</para> |
|
|
| 151 |
</listitem> |
133 |
</listitem> |
| 152 |
</varlistentry> |
134 |
</varlistentry> |
| 153 |
|
135 |
|
|
Lines 169-176
Link Here
|
| 169 |
<listitem> |
151 |
<listitem> |
| 170 |
<para>Scheme ¬O LISP ªº¥t¤@¤À¤ä¡AScheme ªº¯SÂI´N¬O¤ñ Common LISP ÁÙn²¼ä¦³¤O¡C |
152 |
<para>Scheme ¬O LISP ªº¥t¤@¤À¤ä¡AScheme ªº¯SÂI´N¬O¤ñ Common LISP ÁÙn²¼ä¦³¤O¡C |
| 171 |
¥Ñ©ó Scheme ²³æ¡A©Ò¥H«Ü¦h¤j¾Ç®³¨Ó·í§@²Ä¤@°óµ{¦¡»y¨¥±Ð¾Ç±Ð§÷¡C |
153 |
¥Ñ©ó Scheme ²³æ¡A©Ò¥H«Ü¦h¤j¾Ç®³¨Ó·í§@²Ä¤@°óµ{¦¡»y¨¥±Ð¾Ç±Ð§÷¡C |
| 172 |
¦Ó¥B¹ï©ó¬ã¨s¤Hû¨Ó»¡¤]¥i¥H§Ö³tªº¶}µo¥L̩һÝnªºµ{¦¡¡C |
154 |
¦Ó¥B¹ï©ó¬ã¨s¤Hû¨Ó»¡¤]¥i¥H§Ö³tªº¶}µo¥L̩һÝnªºµ{¦¡¡C</para> |
| 173 |
</para> |
|
|
| 174 |
|
155 |
|
| 175 |
<para>Scheme ¦¬¿ý¦b <filename role="package">lang/elk</filename>¡A |
156 |
<para>Scheme ¦¬¿ý¦b <filename role="package">lang/elk</filename>¡A |
| 176 |
Elk Scheme ª½Ä¶¾¹(¥Ñ³Â¬Ù²z¤u¾Ç°|©Òµo®iªº Scheme ª½Ä¶¾¹)¦¬¿ý¦b |
157 |
Elk Scheme ª½Ä¶¾¹(¥Ñ³Â¬Ù²z¤u¾Ç°|©Òµo®iªº Scheme ª½Ä¶¾¹)¦¬¿ý¦b |
|
Lines 208-215
Link Here
|
| 208 |
<para>Python ¬Oª«¥ó¾É¦Vªºª½Ä¶¦¡»y¨¥¡A |
189 |
<para>Python ¬Oª«¥ó¾É¦Vªºª½Ä¶¦¡»y¨¥¡A |
| 209 |
Python ªº¾ÖÅ@ªÌÁ`¬O«ÅºÙ Python ¬O³Ì¦n¤Jªùªºµ{¦¡»y¨¥¡C |
190 |
Python ªº¾ÖÅ@ªÌÁ`¬O«ÅºÙ Python ¬O³Ì¦n¤Jªùªºµ{¦¡»y¨¥¡C |
| 210 |
ÁöµM Python ¥i¥H«Ü²³æªº¶}©l¡A¦ý¬O¤£¥Nªí¥¦´N·|¿éµ¹¨ä¥Lª½Ä¶¦¡»y¨¥(¹³¬O Perl ©M Tcl)¡A |
191 |
ÁöµM Python ¥i¥H«Ü²³æªº¶}©l¡A¦ý¬O¤£¥Nªí¥¦´N·|¿éµ¹¨ä¥Lª½Ä¶¦¡»y¨¥(¹³¬O Perl ©M Tcl)¡A |
| 211 |
¨Æ¹êÃÒ©ú Python ¤]¥i¥H®³¨Ó¶}µo¤j«¬¡B½ÆÂøªºÀ³¥Îµ{¦¡¡C |
192 |
¨Æ¹êÃÒ©ú Python ¤]¥i¥H®³¨Ó¶}µo¤j«¬¡B½ÆÂøªºÀ³¥Îµ{¦¡¡C</para> |
| 212 |
</para> |
|
|
| 213 |
|
193 |
|
| 214 |
<para>&os; Ports Collection ¦¬¿ý¦b <filename role="package">lang/python</filename>¡C</para> |
194 |
<para>&os; Ports Collection ¦¬¿ý¦b <filename role="package">lang/python</filename>¡C</para> |
| 215 |
</listitem> |
195 |
</listitem> |
|
Lines 245-253
Link Here
|
| 245 |
<title>½s;¹</title> |
225 |
<title>½s;¹</title> |
| 246 |
|
226 |
|
| 247 |
<para>½s;¹©Mª½Ä¶¾¹¨âªÌ¬Û¤ñªº¸Ü¡A¦³¨Ç¤£¦P¡Aº¥ý´N¬O¥²¶·¥ý§âµ{¦¡½X²Î²Î¼g¤J¨ìÀɮ׸̱¡A |
227 |
<para>½s;¹©Mª½Ä¶¾¹¨âªÌ¬Û¤ñªº¸Ü¡A¦³¨Ç¤£¦P¡Aº¥ý´N¬O¥²¶·¥ý§âµ{¦¡½X²Î²Î¼g¤J¨ìÀɮ׸̱¡A |
| 248 |
µM«á¥²¶·°õ¦æ½s;¹¨Ó¸ÕµÛ½s͵{¦¡¡A¦pªG½s;¹¤£±µ¨ü©Ò¼gªºµ{¦¡¡A¨º´N¥²¶·¤@ª½×§ïµ{¦¡¡A |
228 |
µM«á¥²¶·°õ¦æ½s;¹¨Ó¸ÕµÛ½s͵{¦¡¡A¦pªG½s;¹¤£±µ¨ü©Ò¼gªºµ{¦¡¡A¨º´N¥²¶·¤@ª½×§ïµ{¦¡¡A |
| 249 |
ª½¨ì½s;¹±µ¨ü¥B§â§Aªºµ{¦¡½sͦ¨°õ¦æÀÉ¡C |
229 |
ª½¨ì½s;¹±µ¨ü¥B§â§Aªºµ{¦¡½sͦ¨°õ¦æÀÉ¡C |
| 250 |
¦¹¥~¡A¤]¥i¥H¦b´£¥Ü©R¥O¦C¡A©Î¦b°£¿ù¾¹¤¤°õ¦æ§A½sͦnªºµ{¦¡¬Ý¬Ý¥¦¬O§_¥i¥H¹B§@¡C |
230 |
¦¹¥~¡A¤]¥i¥H¦b´£¥Ü©R¥O¦C¡A©Î¦b°£¿ù¾¹¤¤°õ¦æ§A½sͦnªºµ{¦¡¬Ý¬Ý¥¦¬O§_¥i¥H¹B§@¡C |
| 251 |
<footnote> |
231 |
<footnote> |
| 252 |
<para>¦pªG¦b´£¥Ü©R¥O¦C¤U°õ¦æ¡A¨º»ò¦³¥i¯à·|²£¥Í core dump¡C</para> |
232 |
<para>¦pªG¦b´£¥Ü©R¥O¦C¤U°õ¦æ¡A¨º»ò¦³¥i¯à·|²£¥Í core dump¡C</para> |
| 253 |
</footnote></para> |
233 |
</footnote></para> |
|
Lines 260-267
Link Here
|
| 260 |
¦Ó½s;¹»Pª½Ä¶¾¹³Ì¤jªº®t§O¦b©ó¡G·í§A·Q§â§A¼g¦nªºµ{¦¡®³¨ì¥t¥~¤@¥x¾÷¾¹¤W¶]®É¡A |
240 |
¦Ó½s;¹»Pª½Ä¶¾¹³Ì¤jªº®t§O¦b©ó¡G·í§A·Q§â§A¼g¦nªºµ{¦¡®³¨ì¥t¥~¤@¥x¾÷¾¹¤W¶]®É¡A |
| 261 |
§A¥un±N½s;¹½sĶ¥X¨Óªº¥i°õ¦æÀÉ¡A®³¨ì·s¾÷¾¹¤W«K¥i¥H°õ¦æ¡A |
241 |
§A¥un±N½s;¹½sĶ¥X¨Óªº¥i°õ¦æÀÉ¡A®³¨ì·s¾÷¾¹¤W«K¥i¥H°õ¦æ¡A |
| 262 |
¦Óª½Ä¶¾¹«h¥²¶·n¨D·s¾÷¾¹¤W¡A¥²¶·n¦³¸ò¥t¤@¥x¾÷¾¹¤W¬Û¦Pªºª½Ä¶¾¹¡A |
242 |
¦Óª½Ä¶¾¹«h¥²¶·n¨D·s¾÷¾¹¤W¡A¥²¶·n¦³¸ò¥t¤@¥x¾÷¾¹¤W¬Û¦Pªºª½Ä¶¾¹¡A |
| 263 |
¤~¯à²ÕͰõ¦æ§Aªºµ{¦¡¡I |
243 |
¤~¯à²ÕͰõ¦æ§Aªºµ{¦¡¡I</para> |
| 264 |
</para> |
|
|
| 265 |
|
244 |
|
| 266 |
<para>½sͦ¡ªºµ{¦¡»y¨¥¥]§t Pascal¡BC ©M C++¡A |
245 |
<para>½sͦ¡ªºµ{¦¡»y¨¥¥]§t Pascal¡BC ©M C++¡A |
| 267 |
C ©M C++ ¤£¬O¤@Ó¿Ë©M¤O¤Q¨¬ªº»y¨¥¡A¦ý¬O«Ü¾A¦X¨ã¦³¸gÅ窺 Programmer¡C |
246 |
C ©M C++ ¤£¬O¤@Ó¿Ë©M¤O¤Q¨¬ªº»y¨¥¡A¦ý¬O«Ü¾A¦X¨ã¦³¸gÅ窺 Programmer¡C |
|
Lines 271-278
Link Here
|
| 271 |
<filename role="package">lang/gpc</filename> ©M <filename role="package">lang/fpc</filename> ¤¤§ä¨ì¡C</para> |
250 |
<filename role="package">lang/gpc</filename> ©M <filename role="package">lang/fpc</filename> ¤¤§ä¨ì¡C</para> |
| 272 |
|
251 |
|
| 273 |
<para>¦pªG§A¥Î¤£¦Pªºµ{¦¡¨Ó¼g½sͦ¡µ{¦¡¡A¨º»ò¤£Â_¦a½s¿è-½sĶ-°õ¦æ-°£¿ùªº³oÓ´`ÀôªÖ©w·|«Ü·Ð¤H¡A |
252 |
<para>¦pªG§A¥Î¤£¦Pªºµ{¦¡¨Ó¼g½sͦ¡µ{¦¡¡A¨º»ò¤£Â_¦a½s¿è-½sĶ-°õ¦æ-°£¿ùªº³oÓ´`ÀôªÖ©w·|«Ü·Ð¤H¡A |
| 274 |
¬°¤F§ó²¤Æ¡B¤è«Kµ{¦¡¶}µo¬yµ{¡A«Ü¦h°Ó·~½s;¹¼t°Ó¶}©lµo®i©Ò¿×ªº <acronym>IDE</acronym>(Integrated Development Environments) ¶}µoÀô¹Ò¡A |
253 |
¬°¤F§ó²¤Æ¡B¤è«Kµ{¦¡¶}µo¬yµ{¡A«Ü¦h°Ó·~½s;¹¼t°Ó¶}©lµo®i©Ò¿×ªº <acronym>IDE</acronym> |
| 275 |
FreeBSD ¹w³]¨Ã¨S¦³§â IDE ¾ã¦X¶i base system ¤¤¡A¦ý¬O§A¥i³z¹L <filename role="package">devel/kdevelop</filename> ¦w¸Ë kdevelop |
254 |
(Integrated Development Environments) ¶}µoÀô¹Ò¡A |
|
|
255 |
FreeBSD ¹w³]¨Ã¨S¦³§â IDE ¾ã¦X¶i base system ¤¤¡A |
| 256 |
¦ý¬O§A¥i³z¹L <filename role="package">devel/kdevelop</filename> ¦w¸Ë kdevelop |
| 276 |
©Î¨Ï¥Î <application>Emacs</application> ¨ÓÅéÅç IDE ¶}µoÀô¹Ò¡C |
257 |
©Î¨Ï¥Î <application>Emacs</application> ¨ÓÅéÅç IDE ¶}µoÀô¹Ò¡C |
| 277 |
¦b«á±ªº <xref linkend="emacs"> ±MÃD±N¤¶²Ð¡A¦p¦ó¥H <application>Emacs</application> ¨Ó§@¬° IDE ¶}µoÀô¹Ò¡C</para> |
258 |
¦b«á±ªº <xref linkend="emacs"> ±MÃD±N¤¶²Ð¡A¦p¦ó¥H <application>Emacs</application> ¨Ó§@¬° IDE ¶}µoÀô¹Ò¡C</para> |
| 278 |
</sect2> |
259 |
</sect2> |
|
Lines 338-344
Link Here
|
| 338 |
|
319 |
|
| 339 |
<para>©¯¹Bªº¬O¡A§A¥i¥H¤£¥Î²z·|¥H¤W²Ó¸`¡A½s;¹³£·|¦Û°Ê§¹¦¨¡C |
320 |
<para>©¯¹Bªº¬O¡A§A¥i¥H¤£¥Î²z·|¥H¤W²Ó¸`¡A½s;¹³£·|¦Û°Ê§¹¦¨¡C |
| 340 |
¦]¬° <command>cc</command> ¥u¬O¬OÓ«eºÝµ{¦¡(front end)¡A¥¦·|¨Ì·Ó¥¿½Tªº°Ñ¼Æ¨Ó©I¥s¬ÛÃöµ{¦¡À°§A³B²z¡C |
321 |
¦]¬° <command>cc</command> ¥u¬O¬OÓ«eºÝµ{¦¡(front end)¡A¥¦·|¨Ì·Ó¥¿½Tªº°Ñ¼Æ¨Ó©I¥s¬ÛÃöµ{¦¡À°§A³B²z¡C |
| 341 |
¥u»Ý¥´¡G |
322 |
¥u»Ý¥´¡G</para> |
| 342 |
<screen>&prompt.user; <userinput>cc foobar.c</userinput></screen> |
323 |
<screen>&prompt.user; <userinput>cc foobar.c</userinput></screen> |
| 343 |
|
324 |
|
| 344 |
<para>¤Wz«ü¥O·|§â <filename>foobar.c</filename> ¶}©l½sĶ¡A¨Ã§¹¦¨¤Wz°Ê§@¡C |
325 |
<para>¤Wz«ü¥O·|§â <filename>foobar.c</filename> ¶}©l½sĶ¡A¨Ã§¹¦¨¤Wz°Ê§@¡C |
|
Lines 362-368
Link Here
|
| 362 |
|
343 |
|
| 363 |
<listitem> |
344 |
<listitem> |
| 364 |
<para><option>-o</option> ½sĶ«áªº°õ¦æÀÉÀɦW¡A¦pªG¨S¦³¨Ï¥Î³o¿ï¶µªº¸Ü¡A |
345 |
<para><option>-o</option> ½sĶ«áªº°õ¦æÀÉÀɦW¡A¦pªG¨S¦³¨Ï¥Î³o¿ï¶µªº¸Ü¡A |
| 365 |
½sͦnªºµ{¦¡¹w³]ÀɦW±N·|¬O <filename>a.out</filename> |
346 |
½sͦnªºµ{¦¡¹w³]ÀɦW±N·|¬O <filename>a.out</filename> |
| 366 |
|
347 |
|
| 367 |
<footnote> |
348 |
<footnote> |
| 368 |
<para>¦Ü©ó <option>-o</option> ªºì¦]¡A«h¬O¤@¹Î¾ú¥v°gÃú¤F¡C</para> |
349 |
<para>¦Ü©ó <option>-o</option> ªºì¦]¡A«h¬O¤@¹Î¾ú¥v°gÃú¤F¡C</para> |
|
Lines 398-405
Link Here
|
| 398 |
<term><option>-g</option></term> |
379 |
<term><option>-g</option></term> |
| 399 |
|
380 |
|
| 400 |
<listitem> |
381 |
<listitem> |
| 401 |
<para> |
382 |
<para><option>-g</option> ±N·|§â¤@¨Çµ¹ gdb ¥Îªº°£¿ù°T®§¥]¶i¥h°õ¦æÀɸ̱¡A©Ò¿×ªº°£¿ù°T®§¨Ò¦p¡G |
| 402 |
<option>-g</option> ±N·|§â¤@¨Çµ¹ gdb ¥Îªº°£¿ù°T®§¥]¶i¥h°õ¦æÀɸ̱¡A©Ò¿×ªº°£¿ù°T®§¨Ò¦p¡G |
|
|
| 403 |
µ{¦¡¦b²Ä´X¦æ¥X¿ù¡B¨ºÓµ{¦¡²Ä´X¦æ°µ¤°»ò¨ç¦¡©I¥sµ¥µ¥¡C°£¿ù¸ê°T<emphasis>«D±`</emphasis>¦n¥Î¡C |
383 |
µ{¦¡¦b²Ä´X¦æ¥X¿ù¡B¨ºÓµ{¦¡²Ä´X¦æ°µ¤°»ò¨ç¦¡©I¥sµ¥µ¥¡C°£¿ù¸ê°T<emphasis>«D±`</emphasis>¦n¥Î¡C |
| 404 |
¦ý¯ÊÂI´N¬O¡G¹ï©óµ{¦¡¨Ó»¡¡AÃB¥~ªº°£¿ù°T®§·|Åý½sĶ¥X¨Óªºµ{¦¡¤ñ¸ûªÎ¨Ç¡C |
384 |
¦ý¯ÊÂI´N¬O¡G¹ï©óµ{¦¡¨Ó»¡¡AÃB¥~ªº°£¿ù°T®§·|Åý½sĶ¥X¨Óªºµ{¦¡¤ñ¸ûªÎ¨Ç¡C |
| 405 |
<option>-g</option> ªº¾A¥Î®É¾÷¦b©ó¡G·íµ{¦¡ÁÙ¦b¶}µo®É¨Ï¥Î´N¦n¡A |
385 |
<option>-g</option> ªº¾A¥Î®É¾÷¦b©ó¡G·íµ{¦¡ÁÙ¦b¶}µo®É¨Ï¥Î´N¦n¡A |
|
Lines 426-438
Link Here
|
| 426 |
|
406 |
|
| 427 |
<listitem> |
407 |
<listitem> |
| 428 |
<para><option>-O</option> ·|²£¥Í³Ì¨Î¤Æªº°õ¦æÀÉ¡A |
408 |
<para><option>-O</option> ·|²£¥Í³Ì¨Î¤Æªº°õ¦æÀÉ¡A |
| 429 |
½s;¹·|¨Ï¥Î¤@¨Ç§Þ¥©¡A¨ÓÅýµ{¦¡¥i¥H¶]ªº¤ñ¥¼¸g³Ì¨Î¤Æªºµ{¦¡ÁÙ§Ö¡A |
409 |
½s;¹·|¨Ï¥Î¤@¨Ç§Þ¥©¡A¨ÓÅýµ{¦¡¥i¥H¶]ªº¤ñ¥¼¸g³Ì¨Î¤Æªºµ{¦¡ÁÙ§Ö¡A |
| 430 |
§A¥i¥H¦b¤j¼g O «á±¥[¤W¼Æ¦r¨Ó«ü©ú§A·Qnªº³Ì¨Î¤Æ¼h¯Å¡C |
410 |
¥i¥H¦b¤j¼g O «á±¥[¤W¼Æ¦r¨Ó«ü©ú·Qnªº³Ì¨Î¤Æ¼h¯Å¡C |
| 431 |
¦ý¬O³Ì¨Î¤ÆÁÙ¬O·|¦³¤@¨Ç¿ù»~¡AÁ|¨Ò¨Ó»¡¦b·í¦b FreeBSD 2.10 release ¤¤¨Ï¥Î <command>cc</command> |
411 |
¦ý¬O³Ì¨Î¤ÆÁÙ¬O·|¦³¤@¨Ç¿ù»~¡AÁ|¨Ò¨Ó»¡¦b FreeBSD 2.10 release ¤¤¥Î <command>cc</command> |
| 432 |
¨Ã¥B«ü©w <option>-O2</option> ®É¡A¦b¬Y¨Ç±¡§Î¤U·|²£¥Í¿ù»~ªº°õ¦æÀÉ¡C</para> |
412 |
¥B«ü©w <option>-O2</option> ®É¡A¦b¬Y¨Ç±¡§Î¤U·|²£¥Í¿ù»~ªº°õ¦æÀÉ¡C</para> |
| 433 |
|
413 |
|
| 434 |
<para>¥u¦³·ínÄÀ¥Xµo¦æª©¥»¡B©ÎªÌ¥[³tµ{¦¡®É¡A¤~»Ýn¨Ï¥Î³Ì¨Î¤Æ¿ï¶µ¡C |
414 |
<para>¥u¦³·ínÄÀ¥Xµo¦æª©¥»¡B©ÎªÌ¥[³tµ{¦¡®É¡A¤~»Ýn¨Ï¥Î³Ì¨Î¤Æ¿ï¶µ¡C</para> |
| 435 |
</para> |
|
|
| 436 |
|
415 |
|
| 437 |
<informalexample> |
416 |
<informalexample> |
| 438 |
<screen>&prompt.user; <userinput>cc -O -o foobar foobar.c</userinput> |
417 |
<screen>&prompt.user; <userinput>cc -O -o foobar foobar.c</userinput> |
|
Lines 444-454
Link Here
|
| 444 |
</varlistentry> |
423 |
</varlistentry> |
| 445 |
</variablelist> |
424 |
</variablelist> |
| 446 |
|
425 |
|
| 447 |
<para> |
426 |
<para>¥H¤U¤TӰѼƱN·|±j¢ <command>cc</command> ½T»{µ{¦¡½X¬O§_²Å¦X¤@¨Ç°ê»Ú¼Ð·Çªº³W½d¡A |
| 448 |
¥H¤U¤TӰѼƱN·|±j¢ <command>cc</command> ½T»{µ{¦¡½X¬O§_²Å¦X¤@¨Ç°ê»Ú¼Ð·Çªº³W½d¡A |
|
|
| 449 |
¤]´N¬O³q±`»¡ªº <acronym>ANSI</acronym> ¼Ð·Ç¡A |
427 |
¤]´N¬O³q±`»¡ªº <acronym>ANSI</acronym> ¼Ð·Ç¡A |
| 450 |
¦Ó <acronym>ANSI</acronym> ÄY®æ¨ÓÁ¿ÄÝ <acronym>ISO</acronym> ¼Ð·Ç¡C |
428 |
¦Ó <acronym>ANSI</acronym> ÄY®æ¨ÓÁ¿ÄÝ <acronym>ISO</acronym> ¼Ð·Ç¡C</para> |
| 451 |
</para> |
|
|
| 452 |
|
429 |
|
| 453 |
<variablelist> |
430 |
<variablelist> |
| 454 |
<varlistentry> |
431 |
<varlistentry> |
|
Lines 501-515
Link Here
|
| 501 |
<para>§i¶D gcc ¦b³sµ²(linking)µ{¦¡®É§A»Ýn¥Î¨ìªº¨ç¦¡®w¦WºÙ¡C</para> |
478 |
<para>§i¶D gcc ¦b³sµ²(linking)µ{¦¡®É§A»Ýn¥Î¨ìªº¨ç¦¡®w¦WºÙ¡C</para> |
| 502 |
|
479 |
|
| 503 |
<para>³Ì±`¨£ªº±¡ªp´N¬O¡A·í§A¦bµ{¦¡¤¤¨Ï¥Î¤F C ¼Æ¾Ç¨ç¦¡®w¡A |
480 |
<para>³Ì±`¨£ªº±¡ªp´N¬O¡A·í§A¦bµ{¦¡¤¤¨Ï¥Î¤F C ¼Æ¾Ç¨ç¦¡®w¡A |
| 504 |
¸ò¨ä¥L§@·~¥¥x¤£¤@¼Ëªº¬O¡A³o¨Ç¼Æ¾Ç¨ç¦¡³£¤£¦b¼Ð·Ç¨ç¦¡®w(library)¤¤¡A |
481 |
¸ò¨ä¥L§@·~¥¥x¤£¤@¼Ëªº¬O¡A³o¨ç¥Ü¾Ç¨ç¦¡³£¤£¦b¼Ð·Ç¨ç¦¡®w(library)¤¤¡A |
| 505 |
¦]¦¹½s;¹¨Ã¤£ª¾¹D³o¨ç¦¡®w¦WºÙ¡A§A¥²¶·§i¶D½s;¹n¥[¤W¥¦¤~¦æ¡C</para> |
482 |
¦]¦¹½s;¹¨Ã¤£ª¾¹D³o¨ç¦¡®w¦WºÙ¡A§A¥²¶·§i¶D½s;¹n¥[¤W¥¦¤~¦æ¡C</para> |
| 506 |
|
483 |
|
| 507 |
<para>³o³W«h«Ü²³æ¡A¦pªG¦³Ó¨ç¦¡®w¥s°µ <filename>lib<replaceable>something</replaceable>/a</filename>¡A |
484 |
<para>³W«h«Ü²³æ¡A¦pªG¦³Ó¨ç¦¡®w¥s°µ <filename>lib<replaceable>something</replaceable>.a</filename>¡A |
| 508 |
´N¥²¶·¦b½sͮɥ[¤W°Ñ¼Æ <option>-l<replaceable>something</replaceable></option> ¤~¦æ¡C |
485 |
´N¥²¶·¦b½sͮɥ[¤W°Ñ¼Æ <option>-l<replaceable>something</replaceable></option> ¤~¦æ¡C |
| 509 |
Á|¨Ò¨Ó»¡¡A¼Æ¾Ç¨ç¦¡®w¥s°µ <filename>libm.a</filename>¡A |
486 |
Á|¨Ò¨Ó»¡¡A¼Æ¾Ç¨ç¦¡®w¥s°µ <filename>libm.a</filename>¡A |
| 510 |
©Ò¥H§A¥²¶·µ¹ <command>cc</command> ªº°Ñ¼Æ´N¬O <option>-lm</option>¡C |
487 |
©Ò¥H§A¥²¶·µ¹ <command>cc</command> ªº°Ñ¼Æ´N¬O <option>-lm</option>¡C |
| 511 |
¤@¯ë±¡ªp¤U¡A³q±`·|§â³o°Ñ¼Æ¥²¶·©ñ¦b«ü¥Oªº³Ì«á¡C |
488 |
¤@¯ë±¡ªp¤U¡A³q±`·|§â³o°Ñ¼Æ¥²¶·©ñ¦b«ü¥Oªº³Ì«á¡C</para> |
| 512 |
</para> |
|
|
| 513 |
|
489 |
|
| 514 |
<informalexample> |
490 |
<informalexample> |
| 515 |
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput> |
491 |
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput> |
|
Lines 522-563
Link Here
|
| 522 |
<option>-lstdc++</option>¡C |
498 |
<option>-lstdc++</option>¡C |
| 523 |
¦pªG§Aªº FreeBSD ¬O 2.2(§t)¥H«áª©¥»¡A |
499 |
¦pªG§Aªº FreeBSD ¬O 2.2(§t)¥H«áª©¥»¡A |
| 524 |
§A¥i¥H¥Î«ü¥O <command>c++</command> ¨Ó¨ú¥N <command>cc</command>¡C |
500 |
§A¥i¥H¥Î«ü¥O <command>c++</command> ¨Ó¨ú¥N <command>cc</command>¡C |
| 525 |
¦b FreeBSD ¤W <command>c++</command> ¤]¥i¥H¥Î <command>g++</command> ¨ú¥N¡C |
501 |
¦b FreeBSD ¤W <command>c++</command> ¤]¥i¥H¥Î <command>g++</command> ¨ú¥N¡C</para> |
| 526 |
</para> |
|
|
| 527 |
|
502 |
|
| 528 |
<informalexample> |
503 |
<informalexample> |
| 529 |
<screen>&prompt.user; <userinput>cc -o foobar foobar.cc -lg++</userinput> <lineannotation>For FreeBSD 2.1.6 and earlier</lineannotation> |
504 |
<screen>&prompt.user; <userinput>cc -o foobar foobar.cc -lg++</userinput> <lineannotation>¾A¥Î FreeBSD 2.1.6 ©Î§ó¦´Áªºª©¥»</lineannotation> |
| 530 |
&prompt.user; <userinput>cc -o foobar foobar.cc -lstdc++</userinput> <lineannotation>For FreeBSD 2.2 and later</lineannotation> |
505 |
&prompt.user; <userinput>cc -o foobar foobar.cc -lstdc++</userinput> <lineannotation>¾A¥Î FreeBSD 2.2 ¤Î¤§«áªºª©¥»</lineannotation> |
| 531 |
&prompt.user; <userinput>c++ -o foobar foobar.cc</userinput> |
506 |
&prompt.user; <userinput>c++ -o foobar foobar.cc</userinput> |
| 532 |
</screen> |
507 |
</screen> |
| 533 |
</informalexample> |
508 |
</informalexample> |
| 534 |
|
509 |
|
| 535 |
<para>Each of these will both produce an executable |
510 |
<para>¤Wz«ü¥O³£·|±qì©lÀÉ <filename>foobar.cc</filename> ½sͲ£¥Í¦W¬° <filename>fooboar</filename> ªº°õ¦æÀÉ¡C |
| 536 |
<filename>foobar</filename> from the C++ source file |
511 |
³oÃän´£¿ôªº¬O¦b &unix; ¨t²Î¤¤ C++ µ{¦¡¶Ç²Î³£¥H <filename>.C</filename>¡B |
| 537 |
<filename>foobar.cc</filename>. Note that, on &unix; |
512 |
<filename>.cxx</filename> ©ÎªÌ¬O <filename>.cc</filename> §@¬°°ÆÀɦW¡A |
| 538 |
systems, C++ source files traditionally end in |
513 |
¦Ó«D &ms-dos; ¨ººØ¥H <filename>.cpp</filename> §@¬°°ÆÀɦWªº©R¦W¤è¦¡(¤£¹L¤]¶V¨Ó¶V´¶¹M¤F)¡C |
| 539 |
<filename>.C</filename>, <filename>.cxx</filename> or |
514 |
<command>gcc</command> ·|¨Ì°ÆÀɦW¨Ó¨M©w¥Îþ¤@ºØ½s;¹½sĶ¡A |
| 540 |
<filename>.cc</filename>, rather than the |
515 |
µM¦Ó¡A²{¦b¤w¸g¤£¦A¨î°ÆÀɦW¤F¡A |
| 541 |
&ms-dos; style |
516 |
©Ò¥H¥i¥H¦Û¥Ñªº¨Ï¥Î <filename>.cpp</filename> §@¬° C++ µ{¦¡½Xªº°ÆÀɦW¡I</para> |
| 542 |
<filename>.cpp</filename> (which was already used for |
|
|
| 543 |
something else). <command>gcc</command> used to rely on |
| 544 |
this to work out what kind of compiler to use on the |
| 545 |
source file; however, this restriction no longer applies, |
| 546 |
so you may now call your C++ files |
| 547 |
<filename>.cpp</filename> with impunity!</para> |
| 548 |
</listitem> |
517 |
</listitem> |
| 549 |
</varlistentry> |
518 |
</varlistentry> |
| 550 |
</variablelist> |
519 |
</variablelist> |
| 551 |
|
520 |
|
| 552 |
<sect2> |
521 |
<sect2> |
| 553 |
<title>Common <command>cc</command> Queries and Problems</title> |
522 |
<title>±`¨£ªº <command>cc</command> °ÝÃD</title> |
| 554 |
|
523 |
|
| 555 |
<qandaset> |
524 |
<qandaset> |
| 556 |
<qandaentry> |
525 |
<qandaentry> |
| 557 |
<question> |
526 |
<question> |
| 558 |
<para>I am trying to write a program which uses the |
527 |
<para>§Ú¥Î <function>sin()</function> ¨ç¥Ü¼¶¼g§Úªºµ{¦¡¡A |
| 559 |
<function>sin()</function> function and I get an error |
528 |
¦ý¬O¦³Ó¿ù»~°T®§(¦p¤U)¡A³o¥NªíµÛ¡H</para> |
| 560 |
like this. What does it mean?</para> |
|
|
| 561 |
|
529 |
|
| 562 |
<informalexample> |
530 |
<informalexample> |
| 563 |
<screen>/var/tmp/cc0143941.o: Undefined symbol `_sin' referenced from text segment |
531 |
<screen>/var/tmp/cc0143941.o: Undefined symbol `_sin' referenced from text segment |
|
Lines 566-575
Link Here
|
| 566 |
</question> |
534 |
</question> |
| 567 |
|
535 |
|
| 568 |
<answer> |
536 |
<answer> |
| 569 |
<para>When using mathematical functions like |
537 |
<para>·í¨Ï¥Î <function>sin()</function> ³oÃþªº¼Æ¾Ç¨ç¥Ü®É¡A |
| 570 |
<function>sin()</function>, you have to tell |
538 |
§A¥²¶·§i¶D cc n©M¼Æ¾Ç¨ç¦¡®w§@³sµ²(linking)¡A´N¹³³o¼Ë¡G</para> |
| 571 |
<command>cc</command> to link in the math library, like |
|
|
| 572 |
so:</para> |
| 573 |
|
539 |
|
| 574 |
<informalexample> |
540 |
<informalexample> |
| 575 |
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput> |
541 |
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput> |
|
Lines 580-588
Link Here
|
| 580 |
|
546 |
|
| 581 |
<qandaentry> |
547 |
<qandaentry> |
| 582 |
<question> |
548 |
<question> |
| 583 |
<para>All right, I wrote this simple program to practice |
549 |
<para>¦n§a¡A§Ú¸ÕµÛ¼g¨Ç²³æªºµ{¦¡¡A¨Ó½m²ß¨Ï¥Î -lm ¿ï¶µ(¸Óµ{¦¡·|¹Bºâ 2.1 ªº 6 ¦¸¤è)</para> |
| 584 |
using <option>-lm</option>. All it does is raise 2.1 to |
|
|
| 585 |
the power of 6.</para> |
| 586 |
|
550 |
|
| 587 |
<informalexample> |
551 |
<informalexample> |
| 588 |
<programlisting>#include <stdio.h> |
552 |
<programlisting>#include <stdio.h> |
|
Lines 597-611
Link Here
|
| 597 |
</programlisting> |
561 |
</programlisting> |
| 598 |
</informalexample> |
562 |
</informalexample> |
| 599 |
|
563 |
|
| 600 |
<para>and I compiled it as:</para> |
564 |
<para>µM«á¶i¦æ½sĶ¡G</para> |
| 601 |
|
565 |
|
| 602 |
<informalexample> |
566 |
<informalexample> |
| 603 |
<screen>&prompt.user; <userinput>cc temp.c -lm</userinput> |
567 |
<screen>&prompt.user; <userinput>cc temp.c -lm</userinput> |
| 604 |
</screen> |
568 |
</screen> |
| 605 |
</informalexample> |
569 |
</informalexample> |
| 606 |
|
570 |
|
| 607 |
<para>like you said I should, but I get this when I run |
571 |
<para>½sĶ«á°õ¦æµ{¦¡¡A±o¨ì¤U±³oµ²ªG¡G</para> |
| 608 |
it:</para> |
|
|
| 609 |
|
572 |
|
| 610 |
<informalexample> |
573 |
<informalexample> |
| 611 |
<screen>&prompt.user; <userinput>./a.out</userinput> |
574 |
<screen>&prompt.user; <userinput>./a.out</userinput> |
|
Lines 613-642
Link Here
|
| 613 |
</screen> |
576 |
</screen> |
| 614 |
</informalexample> |
577 |
</informalexample> |
| 615 |
|
578 |
|
| 616 |
<para>This is <emphasis>not</emphasis> the right answer! |
579 |
<para>«Ü©úÅ㪺¡Aµ{¦¡µ²ªG<emphasis>¤£¬O</emphasis>¥¿½Tµª®×¡A¨ì©³¬OþÃä¥X¿ù¡H</para> |
| 617 |
What is going on?</para> |
|
|
| 618 |
</question> |
580 |
</question> |
| 619 |
|
581 |
|
| 620 |
<answer> |
582 |
<answer> |
| 621 |
<para>When the compiler sees you call a function, it |
583 |
<para>·í½s;¹µo²{§A©I¥s¤@Ó¨ç¥Ü®É¡A¥¦·|½T»{¸Ó¨ç¥Üªº¦^¶ÇÈÃþ«¬(prototype)¡A |
| 622 |
checks if it has already seen a prototype for it. If it |
584 |
¦pªG¨S¦³¯S§O«ü©ú¡A«h¹w³]ªº¦^¶ÇÈÃþ«¬¬° <type>int(¾ã¼Æ)</type>¡C |
| 623 |
has not, it assumes the function returns an |
585 |
«Ü©úÅ㪺¡A§Aªºµ{¦¡©Ò»Ýnªº¨Ã¤£¬O¦^¶ÇÈÃþ§O¬° <type>int</type>¡C</para> |
| 624 |
<type>int</type>, which is definitely not what you want |
|
|
| 625 |
here.</para> |
| 626 |
</answer> |
586 |
</answer> |
| 627 |
</qandaentry> |
587 |
</qandaentry> |
| 628 |
|
588 |
|
| 629 |
<qandaentry> |
589 |
<qandaentry> |
| 630 |
<question> |
590 |
<question> |
| 631 |
<para>So how do I fix this?</para> |
591 |
<para>¨º¦p¦ó¤~¥i¥H×¥¿è©Ò»¡ªº°ÝÃD¡H</para> |
| 632 |
</question> |
592 |
</question> |
| 633 |
|
593 |
|
| 634 |
<answer> |
594 |
<answer> |
| 635 |
<para>The prototypes for the mathematical functions are in |
595 |
<para>¼Æ¾Ç¨ç¥Üªº¦^¶ÇÈÃþ«¬(prototype)·|©w¸q¦b <filename>math.h</filename>¡A |
| 636 |
<filename>math.h</filename>. If you include this file, |
596 |
¦pªG§A¦³ include ³oÀÉ¡A½s;¹´N·|ª¾¹D¸Ó¨ç¥Üªº¦^¶ÇÈÃþ«¬¡A¦p¦¹¤@¨Ó¸Ó¹Bºâ´N·|±o¨ì¥¿½Tªºµ²ªG¡I</para> |
| 637 |
the compiler will be able to find the prototype and it |
|
|
| 638 |
will stop doing strange things to your |
| 639 |
calculation!</para> |
| 640 |
|
597 |
|
| 641 |
<informalexample> |
598 |
<informalexample> |
| 642 |
<programlisting>#include <math.h> |
599 |
<programlisting>#include <math.h> |
|
Lines 647-654
Link Here
|
| 647 |
</programlisting> |
604 |
</programlisting> |
| 648 |
</informalexample> |
605 |
</informalexample> |
| 649 |
|
606 |
|
| 650 |
<para>After recompiling it as you did before, run |
607 |
<para>¥[¤F¤Wz¤º®e¤§«á¡A¦A«·s½sĶ¡A³Ì«á°õ¦æ¡G</para> |
| 651 |
it:</para> |
|
|
| 652 |
|
608 |
|
| 653 |
<informalexample> |
609 |
<informalexample> |
| 654 |
<screen>&prompt.user; <userinput>./a.out</userinput> |
610 |
<screen>&prompt.user; <userinput>./a.out</userinput> |
|
Lines 656-682
Link Here
|
| 656 |
</screen> |
612 |
</screen> |
| 657 |
</informalexample> |
613 |
</informalexample> |
| 658 |
|
614 |
|
| 659 |
<para>If you are using any of the mathematical functions, |
615 |
<para>¦pªG¦³¥Î¨ì¼Æ¾Ç¨ç¦¡¡A<emphasis>½Ð½T©w</emphasis>n¦³ include <filename>math.h</filename> ³oÀÉ¡A |
| 660 |
<emphasis>always</emphasis> include |
616 |
¦Ó¥B°O±on©M¼Æ¾Ç¨ç¦¡®w§@³sµ²¡C</para> |
| 661 |
<filename>math.h</filename> and remember to link in the |
|
|
| 662 |
math library.</para> |
| 663 |
</answer> |
617 |
</answer> |
| 664 |
</qandaentry> |
618 |
</qandaentry> |
| 665 |
|
619 |
|
| 666 |
<qandaentry> |
620 |
<qandaentry> |
| 667 |
<question> |
621 |
<question> |
| 668 |
<para>I compiled a file called |
622 |
<para>¤w¸g½sͦn <filename>foobar.c</filename>¡A |
| 669 |
<filename>foobar.c</filename> and I cannot find an |
623 |
¦ý¬O½sĶ«á§ä¤£¨ì <filename>foobar</filename> °õ¦æÀÉ¡C ¸Ó¥hþÃä§ä©O¡H</para> |
| 670 |
executable called <filename>foobar</filename>. Where has |
|
|
| 671 |
it gone?</para> |
| 672 |
</question> |
624 |
</question> |
| 673 |
|
625 |
|
| 674 |
<answer> |
626 |
<answer> |
| 675 |
<para>Remember, <command>cc</command> will call the |
627 |
<para>°O±o¡A°£«D¦³«ü©w½s͵²ªGªº°õ¦æÀÉÀɦW¡A§_«h¹w³]ªº°õ¦æÀÉÀɦW¬O a.out¡C |
| 676 |
executable <filename>a.out</filename> unless you tell it |
628 |
¥Î <option>-o <replaceable>filename</replaceable></option> °Ñ¼Æ¡A |
| 677 |
differently. Use the |
629 |
´N¥i¥H¹F¨ì©Ò·Qnªºµ²ªG¡A¤ñ¦p¡G</para> |
| 678 |
<option>-o <replaceable>filename</replaceable></option> |
|
|
| 679 |
option:</para> |
| 680 |
|
630 |
|
| 681 |
<informalexample> |
631 |
<informalexample> |
| 682 |
<screen>&prompt.user; <userinput>cc -o foobar foobar.c</userinput> |
632 |
<screen>&prompt.user; <userinput>cc -o foobar foobar.c</userinput> |
|
Lines 687-794
Link Here
|
| 687 |
|
637 |
|
| 688 |
<qandaentry> |
638 |
<qandaentry> |
| 689 |
<question> |
639 |
<question> |
| 690 |
<para>OK, I have an executable called |
640 |
<para>¦n¡A¦³Ó½sͦnªºµ{¦¡¥s°µ <filename>foobar</filename>¡A |
| 691 |
<filename>foobar</filename>, I can see it when I run |
641 |
¥Î <command>ls</command> «ü¥O®É¥i¥H¬Ý¨ì¡A |
| 692 |
<command>ls</command>, but when I type in |
642 |
¦ý°õ¦æ®É¡A°T®§«o»¡«o¨S¦³³oÀɮסC¬°¤°»ò¡H</para> |
| 693 |
<command>foobar</command> at the command prompt it tells |
|
|
| 694 |
me there is no such file. Why can it not find |
| 695 |
it?</para> |
| 696 |
</question> |
643 |
</question> |
| 697 |
|
644 |
|
| 698 |
<answer> |
645 |
<answer> |
| 699 |
<para>Unlike &ms-dos;, &unix; does not |
646 |
<para>»P &ms-dos; ¤£¦Pªº¬O¡A°£«D¦³«ü©w°õ¦æÀɪº¸ô®|¡A |
| 700 |
look in the current directory when it is trying to find |
647 |
§_«h &unix; ¨t²Î¨Ã¤£·|¦b¥Ø«eªº¥Ø¿ý¤U´M§ä§A·Q°õ¦æªºÀɮסC |
| 701 |
out which executable you want it to run, unless you tell |
648 |
¦b«ü¥O¦C¤U¥´ <command>./foobar</command> ¥Nªí |
| 702 |
it to. Either type <command>./foobar</command>, which |
649 |
<quote>°õ¦æ¦b³oӥؿý©³¤U¦W¬° <filename>foobar</filename> ªºµ{¦¡</quote>¡A |
| 703 |
means <quote>run the file called |
650 |
©ÎªÌ¤]¥i¥H§ó§ï <envar>PATH</envar> Àô¹ÒÅܼƳ]©w¦p¤U¡A¥H¹F¦¨Ãþ¦ü®ÄªG¡G</para> |
| 704 |
<filename>foobar</filename> in the current |
|
|
| 705 |
directory</quote>, or change your <envar>PATH</envar> |
| 706 |
environment |
| 707 |
variable so that it looks something like</para> |
| 708 |
|
651 |
|
| 709 |
<informalexample> |
652 |
<informalexample> |
| 710 |
<screen>bin:/usr/bin:/usr/local/bin:. |
653 |
<screen>bin:/usr/bin:/usr/local/bin:. |
| 711 |
</screen> |
654 |
</screen> |
| 712 |
</informalexample> |
655 |
</informalexample> |
| 713 |
|
656 |
|
| 714 |
<para>The dot at the end means <quote>look in the current |
657 |
<para>¤W¤@¦æ³Ì«áªº "." ¥Nªí<quote>¦pªG¦b«e±¼gªº¨ä¥L¥Ø¿ý§ä¤£¨ì¡A´N§ä¥Ø«eªº¥Ø¿ý</quote>¡C</para> |
| 715 |
directory if it is not in any of the |
|
|
| 716 |
others</quote>.</para> |
| 717 |
</answer> |
658 |
</answer> |
| 718 |
</qandaentry> |
659 |
</qandaentry> |
| 719 |
|
660 |
|
| 720 |
<qandaentry> |
661 |
<qandaentry> |
| 721 |
<question> |
662 |
<question> |
| 722 |
<para>I called my executable <filename>test</filename>, |
663 |
<para>¸ÕµÛ°õ¦æ <filename>test</filename> °õ¦æÀÉ¡A |
| 723 |
but nothing happens when I run it. What is going |
664 |
¦ý¬O«o¨S¦³¥ô¦ó¨Æµo¥Í¡A¨ì©³¬Oþ¸Ì¥X¿ù¤F¡H</para> |
| 724 |
on?</para> |
|
|
| 725 |
</question> |
665 |
</question> |
| 726 |
|
666 |
|
| 727 |
<answer> |
667 |
<answer> |
| 728 |
<para>Most &unix; systems have a program called |
668 |
<para>¤j¦h¼Æªº &unix; ¨t²Î³£·|¦b¸ô®| <filename>/usr/bin</filename> Â\©ñ°õ¦æÀÉ¡C |
| 729 |
<command>test</command> in <filename>/usr/bin</filename> |
669 |
°£«D¦³«ü©w¨Ï¥Î¦b¥Ø«e¥Ø¿ý¤ºªº <filename>test</filename>¡A§_«h shell ·|Àu¥ý¿ï¾Ü¦ì¦b |
| 730 |
and the shell is picking that one up before it gets to |
670 |
<filename>/usr/bin</filename> ªº <filename>test</filename>¡A |
| 731 |
checking the current directory. Either type:</para> |
671 |
n«ü©wÀɦWªº¸Ü¡A§@ªkÃþ¦ü¡G</para> |
| 732 |
|
672 |
|
| 733 |
<informalexample> |
673 |
<informalexample> |
| 734 |
<screen>&prompt.user; <userinput>./test</userinput> |
674 |
<screen>&prompt.user; <userinput>./test</userinput> |
| 735 |
</screen> |
675 |
</screen> |
| 736 |
</informalexample> |
676 |
</informalexample> |
| 737 |
|
677 |
|
| 738 |
<para>or choose a better name for your program!</para> |
678 |
<para>¬°¤FÁ×§K¤Wz§xÂZ¡A½Ð¬°§Aªºµ{¦¡¨ú§ó¦nªº¦WºÙ§a¡I</para> |
| 739 |
</answer> |
679 |
</answer> |
| 740 |
</qandaentry> |
680 |
</qandaentry> |
| 741 |
|
681 |
|
| 742 |
<qandaentry> |
682 |
<qandaentry> |
| 743 |
<question> |
683 |
<question> |
| 744 |
<para>I compiled my program and it seemed to run all right |
684 |
<para>·í°õ¦æ§Ú¼gªºµ{¦¡®Éè¶}©l¥¿±`¡A |
| 745 |
at first, then there was an error and it said something |
685 |
±µ¤U¨Ó«o¥X²{ <errorname>core dumped</errorname> ¿ù»~°T®§¡C³o¿ù»~°T®§¨ì©³¥Nªí¤°»ò¡H</para> |
| 746 |
about <errorname>core dumped</errorname>. What does that |
|
|
| 747 |
mean?</para> |
| 748 |
</question> |
686 |
</question> |
| 749 |
|
687 |
|
| 750 |
<answer> |
688 |
<answer> |
| 751 |
<para>The name <firstterm>core dump</firstterm> dates back |
689 |
<para>Ãö©ó <firstterm>core dumped</firstterm> ³oÓ¦WºÙªº¥Ñ¨Ó¡A |
| 752 |
to the very early days of &unix;, when the machines used |
690 |
¥i¥H°l·¹¨ì¦´Áªº &unix; ¨t²Î¶}©l¨Ï¥Î core memory ¹ï¸ê®Æ±Æ§Ç®É¡C |
| 753 |
core memory for storing data. Basically, if the program |
691 |
°ò¥»¤W·íµ{¦¡¦b«Ü¦h±¡ªp¤Uµo¥Í¿ù»~«á¡A |
| 754 |
failed under certain conditions, the system would write |
692 |
§@·~¨t²Î·|§â core memory ¤¤ªº¸ê°T¼g¤J <filename>core</filename> ³oÀɮפ¤¡A |
| 755 |
the contents of core memory to disk in a file called |
693 |
¥H«KÅý programmer ª¾¹Dµ{¦¡¨ì©³¬O¬°¦ó¥X¿ù¡C</para> |
| 756 |
<filename>core</filename>, which the programmer could |
|
|
| 757 |
then pore over to find out what went wrong.</para> |
| 758 |
</answer> |
694 |
</answer> |
| 759 |
</qandaentry> |
695 |
</qandaentry> |
| 760 |
|
696 |
|
| 761 |
<qandaentry> |
697 |
<qandaentry> |
| 762 |
<question> |
698 |
<question> |
| 763 |
<para>Fascinating stuff, but what I am supposed to do |
699 |
<para>¯u¬O¤Ó¯«©_¤F¡Iµ{¦¡©~µMµo¥Í <errorname>core dumped</errorname> ¤F¡A¸Ó«ç»ò¿ì¡H</para> |
| 764 |
now?</para> |
|
|
| 765 |
</question> |
700 |
</question> |
| 766 |
|
701 |
|
| 767 |
<answer> |
702 |
<answer> |
| 768 |
<para>Use <command>gdb</command> to analyze the core (see |
703 |
<para>½Ð¥Î <command>gdb</command> ¨Ó¤ÀªR core µ²ªG(¸Ô±¡½Ð°Ñ¦Ò <xref linkend="debugging">)¡C</para> |
| 769 |
<xref linkend="debugging">).</para> |
|
|
| 770 |
</answer> |
704 |
</answer> |
| 771 |
</qandaentry> |
705 |
</qandaentry> |
| 772 |
|
706 |
|
| 773 |
<qandaentry> |
707 |
<qandaentry> |
| 774 |
<question> |
708 |
<question> |
| 775 |
<para>When my program dumped core, it said something about |
709 |
<para>·íµ{¦¡¤w¸g§â core memory ¸ê®Æ dump ¥X¨Ó«á¡A |
| 776 |
a <errorname>segmentation fault</errorname>. What is |
710 |
¦P®É¤]¥X²{¥t¤@Ó¿ù»~ <errorname>segmentation fault</errorname> ³o·N«ä¬O¡H</para> |
| 777 |
that?</para> |
|
|
| 778 |
</question> |
711 |
</question> |
| 779 |
|
712 |
|
| 780 |
<answer> |
713 |
<answer> |
| 781 |
<para>This basically means that your program tried to |
714 |
<para>°ò¥»¤W¡A³oÓ¿ù»~ªí¥Ü§Aªºµ{¦¡¦b°O¾ÐÅ餤¸ÕµÛ°µ¤@ÓÄY«ªº«Dªk¹B§@(illegal operation)¡A |
| 782 |
perform some sort of illegal operation on memory; &unix; |
715 |
&unix; ´N¬O³Q³]p¨Ó«OÅ@¾ãÓ§@·~¨t²Î§K©ó³Q´c½èªºµ{¦¡¯}Ãa¡A©Ò¥H¤~·|§i¶D§A³oÓ°T®§¡C</para> |
| 783 |
is designed to protect the operating system and other |
|
|
| 784 |
programs from rogue programs.</para> |
| 785 |
|
716 |
|
| 786 |
<para>Common causes for this are:</para> |
717 |
<para>³Ì±`³y¦¨<quote>segmentation fault</quote>ªºì¦]³q±`¬°¡G</para> |
| 787 |
|
718 |
|
| 788 |
<itemizedlist> |
719 |
<itemizedlist> |
| 789 |
<listitem> |
720 |
<listitem> |
| 790 |
<para>Trying to write to a <symbol>NULL</symbol> |
721 |
<para>¸ÕµÛ¹ï¤@Ó <symbol>NULL</symbol> ªº«ü¼Ð(pointer)§@¼g¤Jªº°Ê§@¡A¦p</para> |
| 791 |
pointer, eg</para> |
|
|
| 792 |
|
722 |
|
| 793 |
<programlisting>char *foo = NULL; |
723 |
<programlisting>char *foo = NULL; |
| 794 |
strcpy(foo, "bang!"); |
724 |
strcpy(foo, "bang!"); |
|
Lines 796-820
Link Here
|
| 796 |
</listitem> |
726 |
</listitem> |
| 797 |
|
727 |
|
| 798 |
<listitem> |
728 |
<listitem> |
| 799 |
<para>Using a pointer that has not been initialized, |
729 |
<para>¨Ï¥Î¤@Ó©|¥¼ªì©l¤Æ(initialized)ªº«ü¼Ð¡A¦p¡G</para> |
| 800 |
eg</para> |
|
|
| 801 |
|
730 |
|
| 802 |
<programlisting>char *foo; |
731 |
<programlisting>char *foo; |
| 803 |
strcpy(foo, "bang!"); |
732 |
strcpy(foo, "bang!"); |
| 804 |
</programlisting> |
733 |
</programlisting> |
| 805 |
|
734 |
|
| 806 |
<para>The pointer will have some random value that, |
735 |
<para>©|¥¼ªì©l¤Æªº«ü¼Ðªºªì©lȱN·|¬OÀH¾÷ªº¡A¦pªG§A°÷©¯¹Bªº¸Ü¡A |
| 807 |
with luck, will point into an area of memory that |
736 |
³oÓ«ü¼Ðªºªì©lÈ·|«ü¦V kernel ¤w¸g¥Î¨ìªº°O¾ÐÅé¦ì¸m¡A |
| 808 |
is not available to your program and the kernel will |
737 |
kernel ·|µ²§ô±¼³oÓµ{¦¡¥H½T«O¨t²Î¹B§@¥¿±`¡C¦pªG§A¤£°÷©¯¹B¡A |
| 809 |
kill your program before it can do any damage. If |
738 |
ªì©l«ü¨ìªº°O¾ÐÅé¦ì¸m¬O§Aµ{¦¡¥²¶·n¥Î¨ìªº¸ê®Æµ²ºc(data structures)ªº¦ì¸m¡A |
| 810 |
you are unlucky, it will point somewhere inside your |
739 |
·í³oÓ±¡§Îµo¥Í®Éµ{¦¡±N·|·íªº¤£ª¾¨ä©Ò¥HµM¡C</para> |
| 811 |
own program and corrupt one of your data structures, |
|
|
| 812 |
causing the program to fail mysteriously.</para> |
| 813 |
</listitem> |
740 |
</listitem> |
| 814 |
|
741 |
|
| 815 |
<listitem> |
742 |
<listitem> |
| 816 |
<para>Trying to access past the end of an array, |
743 |
<para>¸ÕµÛ¼g¤J¶W¹L°}¦C(array)¤¸¯ÀӼơA¦p¡G</para> |
| 817 |
eg</para> |
|
|
| 818 |
|
744 |
|
| 819 |
<programlisting>int bar[20]; |
745 |
<programlisting>int bar[20]; |
| 820 |
bar[27] = 6; |
746 |
bar[27] = 6; |
|
Lines 822-829
Link Here
|
| 822 |
</listitem> |
748 |
</listitem> |
| 823 |
|
749 |
|
| 824 |
<listitem> |
750 |
<listitem> |
| 825 |
<para>Trying to store something in read-only memory, |
751 |
<para>¸ÕµÛŪ¼g¦b°ßŪ°O¾ÐÅé(read-only memory)¤¤ªº¸ê®Æ¡A¦p¡G</para> |
| 826 |
eg</para> |
|
|
| 827 |
|
752 |
|
| 828 |
<programlisting>char *foo = "My string"; |
753 |
<programlisting>char *foo = "My string"; |
| 829 |
strcpy(foo, "bang!"); |
754 |
strcpy(foo, "bang!"); |