ÔÚEclipseϵÄC/C++¿ª·¢£¨Eclipse3.2 + CDT 3.1£©
ÒªÈà Eclipse ¿ÉÒÔ¿ª·¢ C/C++ ³Ìʽ£¬Òª¹ÒÉÏ CDT ²Å¿ÉÒÔ¡£
Ê×ÏÈÒªÏÂÔØCDT
CDTµÄ×îа汾ÊÇ 3.1.0£¬ËüÖ§³Öeclipse3.2.0£¬ÆäÏÂÔصØÖ·£ºhttp://download3.eclipse.org/tools/cdt/releases/callisto/dist/3.1.0/£¬»òÕßÊǵ½http://www.eclipse.org/cdt/downloads.phpÏÂÔØÆäËü°æ±¾¡£Èç¹ûÄã°²裝µÄ Eclipse ÊÇ 3.0.x °æ¾Í±Ø須°²裝 CDT 2.1.1 ×îаæ
Èç¹û°²裝µÄ Eclipse ÊÇ 3.1.x °æ£¬¾Í±Ø須°²裝 CDT 3.0 °æ
½ÓÏÂÀ´ÊÇ°²裝
½«½âѹºóµÄfeatures¡¢pluginsÕû¸öÎļþ¼Ð¸´ÖƵ½Eclipse°²裝Ŀ¼ÖУ¬ÖØÐÂÆô¶¯Eclipse¼´¿É¡£ÔÚ½¨Á¢ÐÂÏîÄ¿µÄ´°¿ÚÀ¿´µ½ÒѾÓÐÁË C ¼° C++ µÄÑ¡Ï´ú±í°²裝³É¹¦ÁË¡£Èç¹û¿´²»µ½£¬ºÇºÇ£¬Äã¾Í×Ô¼ºÔÙÊÔ°É¡£
»¹Òª°²裝MinGW——Minimalist GNU for Windows
ËäÒÑÔÚ EclipseÉÏ°²×°ÁËCDT£¬µ«»¹ÐèÒªÒ»¸ö "±àÒïÆ÷" ²ÅÄܱàÒï³Ìʽ£¬ËùÒÔÒªÏÂÔØ¿ÉÔÚWindows»·¾³ÀïʹÓõÄGNU C¡¢C++±àÒïÆ÷£¬ÎÒÕâÀïÒªÏÂÔصÄÊÇ£ºMinGW¡£ËüµÄÏÂÔصØÖ·£ºhttp://sourceforge.net/project/showfiles.php?group_id=2435£¬Èç¹ûûÕÒµ½£¬Ò²¿Éµ½ËüµÄÀϼÒÈ¥ÕÒ£¬ÀϼҵØÖ·ÊÇhttp://www.mingw.org/download.shtml¡£ÎÒÓõÄÊÇ×îа汾£ºMinGW 5.0.3¡£
°²×°¾Í²»Óð³½²ÁË°É£¬¼ÙÉè°²×°ÔÚX:\MinGW¡£°²×°ºóÒªÉèÖÃÆä»·¾³±äÁ¿(Ëĸö)£º
PATH £º
X:\MinGW\bin;
LIBRARY_PATH£º
X:\MinGW\lib
C_INCLUDE_PATH£º
X:\MinGW\include
CPLUS_INCLUDE_PATH£º
X:\MinGW\include\c++\3.2.3;C:\MinGW\include\c++\3.2.3\mingw32;C:\MinGW\include\c++\3.2.3\backward;C:\MinGW\include
»¹ÓÐÁ½¸öϸ½Ú£º
1¡¢ÒòΪEclipseÀïÃæÔ¤ÉèÓÃÀ´±àÒïµÄÎļþÃûΪmake.exe£¬¶øÔÚMingw°²裝ºóÓÃ×÷makeµÄÎļþÃûΪmingw32-make.exe£¬ËùÒÔÒª°Ñmingw32-make ¸ÄÃûΪma
Ïà¹ØÎĵµ£º
/*
**ÅжÏC?ÐÐ??¾³µÄ³ÌÐò
*/
/*
**¾²?³õʼ»¯
*/
int static_variable=5;
void
f()
{
register int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
register char *c1, *c2, *c3, *c4, *c5, *c6, *c7 , *c8, *c9, *c10;
extern int a_very_long_name_to_sec_how_long_they_can_be;
double ......
ѧ¶«Î÷£¬ÍùÍùʵÀý²ÅÊÇ×îÈÃÈ˸ÐÐËȤµÄ£¬ÀÏÊÇѧ»ù´¡ÀíÂÛ£¬²»¶¯ÊÖ£¬¸Ð¾õûÓгɾ͸У¬ºÇºÇ¡£
ÏÂÃæÏÈÀ´Ò»¸öʵÀý¡£ÎÒÃÇͨ¹ý´´½¨Á½¸öÏß³ÌÀ´ÊµÏÖ¶ÔÒ»¸öÊýµÄµÝ¼Ó¡£
»òÐíÕâ¸öʵÀýûÓÐʵ¼ÊÔËÓõļÛÖµ£¬µ«ÊÇÉÔ΢¸Ä¶¯Ò»Ï£¬ÎÒÃǾͿÉÒÔÓõ½ÆäËûµØ·½È¥À¡£
ÏÂÃæÊÇÎÒÃǵĴúÂ룺
/*thread_example.c : c multiple thread p ......
access£¨ÅжÏÊÇ·ñ¾ßÓдæÈ¡ÎļþµÄȨÏÞ£©
¡¡¡¡Ïà¹Øº¯Êý stat£¬open£¬chmod£¬chown£¬setuid£¬setgid
¡¡¡¡±íÍ·Îļþ #include<unistd.h>
¡¡¡¡¶¨Ò庯Êý int access(const char * pathname,int mode);
¡¡¡¡º¯Êý˵Ã÷ access()»á¼ì²éÊÇ·ñ¿ÉÒÔ¶Á/дijһÒÑ´æÔÚµÄÎļþ¡£²ÎÊýmodeÓм¸ÖÖÇé¿ö×éºÏ£¬R_OK ......
http://uncrustify.sourceforge.net/
Ident code, aligning on parens, assignments, etc
Align on '=' and variable definitions
Align structure initializers
Align #define stuff
Align backslash-newline stuff
Reformat comments (a little bit)
Fix inter-character spacing
Add or remove parens on return ......
¹æÔò»ò½¨Ò顣ÿÌõ×¼Ôò¶¼ÓÐÀýÍâ
1£¬¼ÙÏëµÄ±àÒë³ÌÐò
ʹÓñàÒë³ÌÐòËùÓеĿÉÑ¡¾¯¸æÉèÊ©
ʹÓÃlintÀ´²é³ö±àÒë³ÌÐò©µôµÄ´íÎó
Èç¹ûÓе¥Ôª²âÊÔ£¬¾Í½øÐе¥Ôª²âÊÔ
2£¬×Ô¼ºÉè¼Æ²¢Ê¹ÓöÏÑÔ
¼ÈҪά»¤³ÌÐòµÄ½»¸¶°æ±¾£¬ÓÖҪά»¤³ÌÐòµÄµ÷ÊÔ°æ±¾
ҪʹÓöÏÑÔ¶Ôº¯Êý²ÎÊý½øÐÐÈ·ÈÏ
Òª´Ó³ÌÐòÖÐɾȥÎÞ¶¨ÒåµÄÌØÐÔ£¬»òÕßÔÚ³ÌÐòÖÐʹÓöÏÑÔÀ´¼ ......