Linux ¾²Ì¬Ó붯̬Á´½Ó¿â
ÎÄÕÂÑ¡È¡µÄÀý×ӷdz£¼òµ¥£¬ÉÏÊÖÈÝÒ×£¬Ö»ÊÇΪÁ˽²Êö¾²Ì¬Ó붯̬Á´½Ó¿âµÄÉú³ÉºÍÁ´½Ó¹ý
³Ì£¬»¹ÓÐËûÃÇÖ®¼äµÄÇø±ð¡£ÒÔÏÂÀý×ÓÔÚ gcc 4.1.1 ÏÂ˳Àûͨ¹ý¡£
ÎļþÔ¤ÀÀ
ÎļþĿ¼Ê÷ÈçÏ£¬ÈçÄãËù¼û£¬·Ç³£¼òµ¥¡£
libtest/
|-- lt.c
|-- lt.h
`-- test.c
´úÂë
#lt.c
/* lt.c
*
*/
#include <stdio.h>
void myprint(void)
{
printf("Linux library test!\n");
}
# lt.h
/* lt.h
*
*/
void myprint(void);
#test.c
/* test.c
*
*/
#include "lt.h"
int main(void)
{
myprint();
return 0;
}
ÏÈ¿´¾²Ì¬¿â
Ê×ÏÈ×ö³É¾²Ì¬¿â liblt.a ¡£
$ gcc -c lt.c -o lt.o
$ ar cqs liblt.a lt.o
ÔÙÕߣ¬Á´½Ó£¬ÕâÀïÖ¸¶¨Á˾²Ì¬¿âµÄλÖã¬×¢ÒâÎļþ˳Ðò²»¿ÉÂÒÐò¡£
$ gcc test.o liblt.a -o test
Õâ¸öʱºòÔÙÀ´¿´ËûµÄÒýÓÿâÇé¿ö¡£
$ ldd test
linux-gate.so.1 => (0xffffe000)
libc.so.6 => /lib/libc.so.6 (0xb7e29000)
/lib/ld-linux.so.2 (0xb7f6e000)
¶¯Ì¬¿â
×ö³É¶¯Ì¬¿â liblt.so ¡£
$ gcc -c lt.c -o lt.o
$ gcc -shared -Wall -fPIC lt.o -o liblt.so
Á´½Ó·½·¨I£¬¿½±´µ½ÏµÍ³¿âÀïÔÙÁ´½Ó£¬ÈÃgcc×Ô¼º²éÕÒ
$ sudo cp liblt.so /usr/lib
$ gcc -o test test.o -llt
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
ÔÚLinux C±à³ÌÖÐʹÓÃUnicodeºÍUTF-8
Ä¿Ç°¸÷ÖÖLinux·¢Ðа涼֧³ÖUTF-8±àÂ룬µ±Ç°ÏµÍ³µÄÓïÑÔºÍ×Ö·û±àÂëÉèÖñ£´æÔÚһЩ»·¾³±äÁ¿ÖУ¬¿ÉÒÔͨ¹ýlocaleÃüÁî²é¿´£º
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US ......
1. Íø¿¨ÅäÖÃÎļþËùÔÚµÄĿ¼Ϊ£»
/etc/sysconfig/network/
a. ifcfg-eth-id-00:0c:29:94:c8:86(Õâ¸öΪÍø¿¨µÄÅäÖÃ±í£¬Ö÷ÒªÓÐipµØÖ·£¬×ÓÍøÑÚÂ룬¹ã²¥µØÖ·)£¨Ò²¿Éͨ¹ýÃüÁîʵÏÖ: ifconfig eth0 192.168.100.1 netmask 255.255.255.0£©
b. & ......
Ò»£®Ìî¿ÕÌ⣺
1. ÔÚLinuxϵͳÖУ¬ÒÔÎļþ·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ/etc/fstabÖжÁÈ¡Òª¼ÓÔصÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓÃi½ÚµãÀ´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪÒýµ¼¿é ¡¢×¨ÓÃ¿é ¡¢ i½Úµã±í¿é ºÍ´æ´¢¿éÊý¾Ý¡£
5. Á´½Ó·ÖΪ£ºÓ²Á´½Ó ºÍ ·ûºÅÁ´½Ó¡£
6. ³¬¼¶¿é°üº¬ÁËi½Úµã±í ......
Linux ÄÚºËÖÐµÄ GCC ÌØÐÔ(ת£©
Á˽âÓÃÓÚ C ÓïÑ﵀ GCC À©Õ¹
ÎĵµÑ¡Ïî
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt=&qu ......