ÔÚLinuxÉÏʹÓÃGeany¾ÙÐÐC/C++±à³ÌµÄÍƼöÉèÖÃ
ÔÚlinuxÉÏʹÓÃgeany¾ÙÐÐc/c++±à³ÌµÄÍƼöÉèÖÃ
¼ò½é
GeanyÊÇÒ»¿îÇáÁ¿¼¶µÄ¼¯³É¿ª·¢ÇéÐΣ¨IDE£©£¬ÌØÊâÊÊÓÃÓÚCºÍC++µÄ±à³Ì¡£ËüÌṩÁËÒ»¸ö¾«Á·¶øÒ×ÓÚʹÓõĽçÃ棬ͬʱ¾ß±¸ÁËһЩ³£ÓõĹ¦Ð§ÒÔÌá¸ß±à³ÌЧÂÊ¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚLinuxÉϾÙÐÐGeanyµÄÉèÖã¬ÒÔ±ã¸üºÃµØ¾ÙÐÐC/C++±à³Ì¡£
×°ÖÃGeany
ÔÚ´ó´ó¶¼Linux¿¯ÐаæÖУ¬Í¨¹ý°ü¹ÜÀíÆ÷¼´¿ÉÖ±½Ó×°ÖÃGeany¡£ÀýÈ磬ÔÚUbuntuÉÏ¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁî¾ÙÐÐ×°Öãº
sudo apt-get install geany
µÇ¼ºó¸´ÖÆ
Ò»µ©×°ÖÃÍê³É£¬Äã¾Í¿ÉÒÔÔÚÓ¦ÓóÌÐò²Ëµ¥ÖÐÕÒµ½Geany¡£
ÉèÖñàÒëÆ÷
ÔÚGeanyÖУ¬ÎÒÃÇÐèÒªÉèÖÃC/C++µÄ±àÒëÆ÷£¬ÒÔ±ãÄܹ»±àÒëºÍÔËÐÐ×ðÁú¿Ê±³ÌÐò¡£Ä¬ÈÏÇéÐÎÏ£¬GeanyʹÓÃGCC×÷Ϊ±àÒëÆ÷£¬µ«ÎÒÃÇÈÔÈ»ÐèҪȷ±£×ðÁú¿Ê±ÏµÍ³ÒÑ×°ÖÃGCC¡£
¹ØÓÚUbuntuÓû§£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî×°ÖÃGCC£º
sudo apt-get install build-essential
µÇ¼ºó¸´ÖÆ
¹ØÓÚÆäËûLinux¿¯Ðа棬Çëƾ֤ÏêϸÇéÐÎ×°ÖÃGCC¡£
Á¬Ã¦Ñ§Ï°¡°C++Ãâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
Ò»µ©GCC×°ÖÃÍê³É£¬ÎÒÃÇÐèÒªÔÚGeanyÖÐÉèÖÃGCC×÷ΪĬÈϱàÒëÆ÷¡£·¿ªGeany²¢µã»÷²Ëµ¥À¸ÖеĔBuild”Ñ¡ÏÔÙÑ¡Ôñ”Set Build Commands”¡£ÔÚµ¯³öµÄ´°¿ÚÖУ¬ÊäÈëÒÔÏÂÏÂÁî²¢ÉúÑÄ£º
Compile: gcc -Wall -c "%f" Build: gcc -Wall -o "%e" "%f" Execute: "./%e"
µÇ¼ºó¸´ÖÆ
ÕâÑù£¬µ±ÎÒÃÇ°´ÏÂF9ʱ£¬Geany½«Ê¹ÓÃGCC±àÒëC/C++´úÂ룬²¢Ö´ÐÐÌìÉúµÄ¿ÉÖ´ÐÐÎļþ¡£
´úÂëʾÀý
ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄC³ÌÐòʾÀý£¬Ëü½«ÅÌËã²¢´òÓ¡ì³²¨ÄÇÆõÊýÁеÄÇ°n¸öÊý×Ö£º
#include <stdio.h> int main() { int n, t1 = 0, t2 = 1, nextTerm; printf("ÇëÊäÈëÒª´òÓ¡µÄì³²¨ÄÇÆõÊýÁеÄÏîÊý£º"); scanf("%d", &n); printf("ì³²¨ÄÇÆõÊýÁеÄÇ° %d ¸öÊý×ÖÊÇ£º ", n); for (int i = 1; i <= n; i++) { printf("%d, ", t1); nextTerm = t1 + t2; t1 = t2; t2 = nextTerm; } return 0; }
µÇ¼ºó¸´ÖÆ
½«´Ë´úÂëÉúÑÄΪһ¸öÃûΪfibonacci.cµÄÎļþ£¬²¢ÔÚGeanyÖз¿ª¸ÃÎļþ¡£°´ÏÂF9±àÒëºÍÔËÐдúÂ룬Ä㽫ÔÚÊä³ö´°¿ÚÖп´µ½ì³²¨ÄÇÆõÊýÁеÄÇ°n¸öÊý×Ö¡£
¸ß¼¶ÉèÖÃ
Geany»¹ÌṩÁËÆäËûһЩ¸ß¼¶ÉèÖÃÑ¡ÏÒÔÖª×ã¸üÏêϸµÄÐèÇó¡£Í¨¹ýµã»÷²Ëµ¥À¸ÖеĔEdit”Ñ¡ÏȻºóÑ¡Ôñ”Preferences”À´»á¼ûÉèÖýçÃæ¡£
ÔÚ”General”Ñ¡ÏÖУ¬Äã¿ÉÒÔ¸ü¸Ä±à¼Æ÷µÄ×ÖÌå¡¢ÑÕÉ«¼Æ»®ºÍÏÔʾÐкŵÈÉèÖá£ÔÚ”Keybindings”Ñ¡ÏÖУ¬Äã¿ÉÒÔ×Ô½ç˵¿ì½Ý¼ü£¬ÒÔ±ã¸ü¿ì¸üÀû±ãµØʹÓÃGeany¡£
±ðµÄ£¬ÔÚGeanyµÄ¹Ù·½ÍøÕ¾ÉÏ»¹¿ÉÒÔÏÂÔغÍ×°Öòå¼þ£¬ÒÔ½øÒ»²½À©Õ¹Æ书Ч¡£
×ܽá
ͨ¹ýÉÏÊöÉèÖúʹúÂëʾÀý£¬ÄãÒѾÏàʶÁËÔõÑùÔÚLinuxÉÏʹÓÃGeany¾ÙÐÐC/C++±à³Ì¡£GeanyÊÇÒ»¿îÇ¿Ê¢¶øÇáÁ¿¼¶µÄIDE£¬ËüÌṩÁËÒ»¸ö¾«Á·¡¢Ò×ÓõĽçÃæºÍһЩ³£ÓõĹ¦Ð§£¬Äܹ»´ó´óÌá¸ßÄãµÄ±à³ÌЧÂÊ¡£Ï£Íû±¾ÎĶÔÄãÔÚLinuxÉÏʹÓÃGeany¾ÙÐÐC/C++±à³ÌµÄÉèÖÃÓÐËù×ÊÖú£¡
ÒÔÉϾÍÊÇÔÚLinuxÉÏʹÓÃGeany¾ÙÐÐC/C++±à³ÌµÄÍƼöÉèÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡