Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C/C++ÖÐÖظ´¶¨ÒåµÄÎÊÌâ


ÓÃ#include¿ÉÒÔ°üº¬ÆäËûÍ·ÎļþÖбäÁ¿¡¢º¯ÊýµÄÉùÃ÷£¬ÎªÊ²Ã´»¹Òªextern¹Ø¼ü×Ö,Èç¹ûÎÒÏëÒýÓÃÒ»¸öÈ«¾Ö±äÁ¿»ò
º¯Êýa£¬ÎÒÖ»ÒªÖ±½ÓÔÚÔ´ÎļþÖаüº¬#include<xxx.h>
(xxx.h°üº¬ÁËaµÄÉùÃ÷)²»¾Í¿ÉÒÔÁËô£¬ÎªÊ²Ã´»¹ÒªÓÃexternÄØ£¿£¿Õâ¸öÎÊÌâÒ»Ö±Ò²ÊÇËÆÊǶø·ÇµÄÀ§ÈÅ×ÅÎÒÐí¶àÄêÁË£¬½ñÌìÉÏÍøºÝºÝ²éÁËÒ»ÏÂ×ÜËãСÓÐ
Ëù»ñÁË£º
Í·Îļþ
Ê×ÏÈ˵ÏÂÍ·Îļþ£¬ÆäʵͷÎļþ¶Ô¼ÆËã»ú¶øÑÔûʲô×÷Óã¬ËýÖ»ÊÇÔÚÔ¤±à
ÒëʱÔÚ#includeµÄµØ·½Õ¹¿ªÒ»Ï£¬Ã»±ðµÄÒâÒåÁË£¬ÆäʵͷÎļþÖ÷ÒªÊǸø±ðÈË¿´µÄ¡£
ÎÒ×ö¹ýÒ»¸öʵÑ飬½«Í·ÎļþµÄºó׺¸Ä³Éxxx.txt£¬È»ºóÔÚÒýÓøÃÍ·ÎļþµÄµØ·½ÓÃ
#include"xxx.txt"
±àÒ룬Á´½Ó¶¼ºÜ˳ÀûµÄ¹ýÈ¥ÁË£¬ÓÉ´Ë¿ÉÖª£¬Í·Îļþ½ö½öΪÔĶÁ´úÂë×÷Óã¬Ã»ÆäËûµÄ×÷ÓÃ
ÁË£¡
²»¹ÜÊÇC»¹ÊÇC++£¬Äã°ÑÄãµÄº¯Êý£¬±äÁ¿»òÕ߽ṹÌ壬ÀàɶµÄ·ÅÔÚÄãµÄ.c»òÕß.cppÎļþÀȻºó±àÒë³É
lib,dll,obj,.oµÈµÈ£¬È»ºó±ðÈËÓõÄʱºò ×î»ù±¾µÄgcc hisfile.cpp yourfile.o|obj|dll|lib µÈµÈ¡£
µ«
¶ÔÓÚÎÒÃdzÌÐòÔ±¶øÑÔ£¬ËûÃÇÔõô֪µÀÄãµÄlib,dll...ÀïÃæµ½µ×ÓÐʲô¶«Î÷£¿Òª¿´ÄãµÄÍ·Îļþ¡£ÄãµÄÍ·Îļþ¾ÍÊǶÔÓû§µÄ˵Ã÷¡£º¯Êý£¬²ÎÊý£¬¸÷ÖÖ¸÷ÑùµÄ½Ó
¿ÚµÄ˵Ã÷¡£
   
ÄǼÈÈ»ÊÇ˵Ã÷£¬ÄÇôͷÎļþÀïÃæ·ÅµÄ×Ô
È»¾ÍÊǹØÓÚº¯Êý£¬±äÁ¿£¬ÀàµÄ“ÉùÃ÷
”ÁË¡£¼Ç×Å£¬ÊÇ“ÉùÃ÷”£¬
²»ÊÇ“¶¨Ò唡£
ÄÇô£¬ÎÒ¼ÙÉè´ó¼ÒÖªµÀÉùÃ÷ºÍ¶¨ÒåµÄ
Çø±ð¡£ËùÒÔ£¬×îºÃ²»ÒªÉµÎûÎûµÄÔÚÍ·ÎļþÀﶨÒåʲô¶«Î÷¡£±ÈÈçÈ«¾Ö±äÁ¿£º
/*xxÍ·Îļþ*/
#ifndef _XX_Í·Îļþ.H
#define _XX_Í·Îļþ.H
int A;
#endif
ÄÇô£¬ºÜÔã¸âµÄÊÇ£¬ÕâÀïµÄint
AÊǸöÈ«¾Ö±äÁ¿µÄ¶¨Ò壬ËùÒÔÈç¹ûÕâ¸öÍ·Îļþ±»¶à´ÎÒýÓõĻ°£¬ÄãµÄA»á±»Öظ´¶¨Òå
ÏÔÈ»Óï·¨ÉÏ´íÁË¡£Ö»²»¹ýÓÐÁËÕâ¸ö#ifndefµÄÌõ¼þ±àÒ룬ËùÒÔÄܱ£Ö¤ÄãµÄÍ·ÎļþÖ»±»ÒýÓÃÒ»
´Î£¬²»¹ýÒ²Ðí»¹ÊÇ»á²í×Ó£¬µ«Èô¶à¸öcÎļþ°üº¬Õâ¸öÍ·Îļþʱ»¹ÊÇ»á³ö´íµÄ£¬ÒòΪºêÃûÓÐЧ·¶Î§½öÏÞÓÚ±¾cÔ´Îļþ£¬ËùÒÔÔÚÕâ¶à¸öcÎļþ±àÒëʱÊDz»»á³ö´íµÄ£¬µ«ÔÚ
Á´½Óʱ¾Í»á±¨´í£¬ËµÄã¶à´¦¶¨ÒåÁËͬһ¸ö±äÁ¿£¬
Linking...
incl2.obj : error
LNK2005: "int glb" (?glb@@3HA
) already
defined in incl1.obj
Debug/incl.exe : fatal error LNK1169: one
or more multiply defined symbols found
×¢Ò⣡£¡£¡
extern
Õâ¸ö¹Ø¼ü×Ö
ÕæµÄ±È½Ï¿É¶ñ£¬ÔÚÉùÃ÷µÄʱºò£¬Õâ¸öextern¾ÓÈ»¿ÉÒÔ±»Ê¡ÂÔ£¬ËùÒÔ»áÈÃÄã¸ã²»Çå³þµ½µ×ÊÇÉùÃ÷»¹ÊǶ¨Ò壬ÏÂÃæ·Ö±äÁ¿ºÍ


Ïà¹ØÎĵµ£º

linux 2.6.24ÔÚS3C2410ÉϵÄÒÆÖ²(1)(»ùÓÚGEC2410)

1.ÏÂÔØlinux kernelÔ´´úÂë
µ½http://www.kernel.org/ÏÂÔØlinuxÄÚºËÔ´´úÂë,ÕâÀïÎÒÃÇʹÓÃ2.6.24.4µÄÄÚºË.
½âѹlinux-2.6.24.4.tar.bz2
[matt@localhost GEC2410]$ tar -xvjf linux-2.6.24.4.tar.bz2
[matt@localhost GEC2410]$ cd linux-2.6.24.4
2.ÐÞ¸ÄMakefile,ÉèÖý»²æ±àÒëÆ÷
ARCH  ?= arm
CROSS_COMPILE ......

C/C++λ²Ù×÷

C/C++λ²Ù×÷
Ò»¡¢´«Í³µÄC·½Ê½Î»²Ù×÷£º
1.»ù±¾²Ù×÷£º
  ʹÓÃÒ»¸öunsigned int±äÁ¿À´×÷ΪλÈÝÆ÷¡£
2.²Ù×÷·û£º
|  °´Î»»ò²Ù×÷·û£ºresult=exp1|exp2;µ±exp1ºÍexp2ÖжÔӦλÖÐÖÁÉÙÓÐÒ»¸öΪ1ʱ£¬resultÖжÔӦλΪ1£¬·ñÔòΪ0¡£
&  °´Î»Óë²Ù×÷·û£º£ºresult=exp1&exp2;µ±exp1ºÍexp2ÖжÔӦλȫΪ1ʱ ......

symbian Open C and Open C++ Ïà¹Ø

nokia wiki£ºhttp://developer.symbian.org/wiki/index.php/Open_C_and_Open_C%2B%2B_Technical_Overview/zh-hans
symbianÉÏ¿ª·¢opencʱÐèҪעÒâµÄÎÊÌâ
http://blog.csdn.net/sizhiguo/archive/2009/05/21/4206138.aspx
µÚÒ»£ºÈçprintf¡¢sprint¡¢Îļþ²Ù×÷¡¢socket²Ù×÷µÈ£¬Ä£ÄâÆ÷ÆÁÄ»¶¼»á³öÏÖ°×ÆÁµÈ´ý£¬²¢ÇÒÊÇÒ»Ö±ÏÂÈ¥¡£ ......

linux C forkº¯Êý

´´½¨Ð½ø³Ì£ºforkº¯Êý
1.1.1. forkº¯Êý¸Éʲô£¿
     #include <sys/types.h>
     #include <unistd.h>
     pid_t fork(void);
      ‘fork()’º¯ÊýÓÃÓÚ´ÓÒÑ´æÔÚ½ø³ÌÖд´½¨Ò»¸öнø³Ì¡£Ð½ø³Ì³ÆΪ×Ó½ ......

±àд¿ÉÒÆÖ²C/C++³ÌÐòÒªµã

      1.·Ö²ãÉè¼Æ£¬¸ôÀëƽ̨Ïà¹ØµÄ´úÂë¡£¾ÍÏñ¿É²âÊÔÐÔÒ»Ñù£¬¿ÉÒÆÖ²ÐÔÒ²Òª´ÓÉè¼Æ×¥Æð¡£Ò»°ãÀ´Ëµ£¬×îÉϲãºÍ×îϲ㶼²»¾ßÓÐÁ¼ºÃµÄ¿ÉÒÆÖ²ÐÔ¡£×îÉϲãÊÇ
GUI£¬´ó¶àÊýGUI¶¼²»ÊÇ¿çƽ̨µÄ£¬ÈçWin32 SDKºÍMFC¡£×îϲãÊDzÙ×÷ϵͳAPI£¬´ó¶à²¿·Ö²Ù×÷ϵͳAPI¶¼ÊÇרÓõġ£
¡¡¡¡
Èç¹ûÕâÁ½²ãµÄ´úÂëÉ¢²¼ÔÚÕû¸öÈí¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ