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

Linux ¹²Ïí¿â±à³Ì[ת]

Linux ¹²Ïí¿â±à³Ì
×÷ÕߣºÖÕÄÏ   <li.zhongnan@hotmail.com
>
1¡¢½éÉÜ
¶¯Ì¬¿âÊdzÌÐòÉè¼Æ³£Óõļ¼Êõ£¬²ÉÓö¯Ì¬¿â¿ÉÒÔÓÐЧµÄ¼õÉÙ³ÌÐò´óС£¬½ÚÊ¡¿Õ¼ä£¬Ìá¸ßЧÂÊ£¬Ôö¼Ó³ÌÐòµÄ¿ÉÀ©Õ¹ÐÔ£¬±ãÓÚÄ£¿é»¯¹ÜÀí¡£ÔÚWindowsºÍ
Linux²Ù×÷ϵͳÖж¼Óж¯Ì¬¿âµÄ¸ÅÄî¡£Windows½«Æä³ÆÎª¶¯Ì¬Á´½Ó¿â£¨Dynamic Link
Library£¬DLL£©£¬ÆäÎļþÀ©Õ¹ÃûΪ.dll£¬Linux³ÆÆäΪ¹²Ïí¿â¼¼Êõ£¨Shared Library£©£¬ÏàÓ¦µÄ¹²Ïí¿âÎļþÀ©Õ¹ÃûΪ.so¡£
¹ÊÃû˼Ò壬¶¯Ì¬¿âÔÚ³ÌÐòÔËÐеÄʱºò±»¶¯Ì¬Á´½Ó¡£µ«ÊÇÔÚ¾ßÌåʹÓö¯Ì¬¿âµÄʱºòÈ´ÓÐÁ½ÖÖ²»Í¬µÄ·½Ê½£ºÒþʽÁ´½ÓºÍÏÔʽÁ´½Ó¡£ÒþʽÁ´½ÓÔÚ±àÒë/Á´½Ó½×¶ÎÍê
³É£¬ÓɱàÒëϵͳ¸ù¾Ý¶¯Ì¬¿âµÄÍ·ÎļþºÍ¿âÎļþ½øÐбàÒëºÍÁ´½Ó£¬´Ó¶øÈ·¶¨´ýµ÷Óõĺ¯ÊýÔ­Ðκ͵ØÖ·¡£ÏÔʽÁ´½ÓÔòÊÇÀûÓÃAPIº¯ÊýʵÏÖ¼ÓÔØºÍÐ¶ÔØ¹²Ïí¿â£¬»ñÈ¡´øµ÷
Óú¯ÊýµØÖ·£¬»ñÈ¡´íÎóÐÅÏ¢µÈ¹¦ÄÜ¡£
2¡¢ÒþʽÁ´½Ó¾ÙÀý
£¨1£©¶¯Ì¬¿âÎļþ´úÂ룺dl_func.c
#include <stdio.h>
extern char name[];
int add(int a, int b)
{
        printf("calling add\n");
        printf("Hello, %s!\n", name);
        return a + b;
}
¸ÃÎļþÖеÄadd()º¯Êý¼ÆËãÁ½¸öÕûÊýÖ®ºÍ£¬²¢ÇÒ´òÓ¡Íⲿ±äÁ¿µÄÖµ£¬¸ÃÍⲿ±äÁ¿Óɵ÷Óù²Ïí¿âµÄÊÂÀý³ÌÐò¶¨Òå¡£
£¨2£©¿Í»§¶ËÊÂÀý´úÂ룺dl_demo1.c
#include <stdio.h>
#include <dlfcn.h>
int add(int a, int b);
char name[100];
int main(int argc, char *argv[]) {
        int a = 10, b = 20;
        int c = 0;
        strcpy(name, "NHN XDBMS");
        c = add(a, b);
        printf("%d + %d = %d\n", a, b, c);
        return 0;
}
¸ÃÊÂÀý³ÌÐòµ÷Óù²Ïí¿âµÄÖеÄadd()º¯Êý¼ÆËãÁ½ÊýÖ®ºó²¢´òÓ¡£¬Í¬Ê±ÔÚÊÂÀý³ÌÐòÖУ¬¸ø±äÁ¿name¸³Öµ£¬ÒÔ±ãÔÚadd()º¯ÊýÖдòÓ¡¡£
£¨3£©±àÒëÓëÔËÐÐ
±àÒë¹²Ïí¿â£º
gcc -o libdl_func.so -fPIC -rdynamic -shared dl_func.c
Ñ¡Ïî-fPICָʾ±àÒëÆ÷½«´úÂë±àÒë³ÉλÖöÀÁ¢µÄ´úÂ룬һ°ãÐèÒªÒÔ³ÌÐòÎļþ


Ïà¹ØÎĵµ£º

Linux µÄ¶àÏ̱߳à³ÌµÄ¸ßЧ¿ª·¢¾­Ñé

2009 Äê 4 ÔÂ 23 ÈÕ
±¾ÎÄÖÐÎÒÃÇÕë¶Ô Linux É϶àÏ̱߳à³ÌµÄÖ÷ÒªÌØÐÔ×ܽá³ö 5 Ìõ¾­Ñ飬ÓÃÒÔ¸ÄÉÆ Linux ¶àÏ̱߳à³ÌµÄϰ¹ßºÍ±ÜÃâÆäÖеĿª·¢ÏÝÚå¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃÇ´©²åһЩ Windows µÄ±à³ÌÓÃÀýÓÃÒÔ¶Ô±È Linux ÌØÐÔ£¬ÒÔ¼ÓÉî¶ÁÕßÓ¡Ïó¡£
±³¾°
Linux ƽ̨ÉϵĶàÏ̳߳ÌÐò¿ª·¢Ïà¶ÔÓ¦ÆäËûƽ̨£¨±ÈÈç Windows£©µÄ¶àÏß³Ì API ÓÐһЩϸ΢ ......

linuxϰ´ÕÂquake3

Ê×ÏÈ£¬Çë°²×°Çý¶¯£¬ÎÒµÄÏÔ¿¨ÊÇnvidia fx5600£¬Ô´ÀïÃæ¾ÍÓÐÇý¶¯£¬Ö±½Ó°²×°¾ÍÊÇ¡£
´úÂë:
sudo apt-get install nvidia-glx nvidia-settings
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
sudo nvidia-glx-config enable
È»ºó
´úÂë:
Ctrl £« Alt £« backspace
ÖØÆôX
½¨Òé²»Òª°ÑnvidiaµÄlogoÈ¥µô£¬ÖÁÉÙÔÚµÚÒ» ......

LinuxÏÂtar gz bz2 tgz zµÈÖÚ¶àѹËõÎļþµÄ½âѹ·½·¨

ת×Ô£ºhttp://www.51testing.com/?action-viewspace-itemid-212094.html
¶ÔÓÚ¸Õ¸Õ½Ó´¥
Linux
µÄÈËÀ´Ëµ£¬Ò»¶¨»á¸øLinuxÏÂÒ»´ó¶Ñ¸÷ʽ¸÷ÑùµÄÎļþÃû¸ø¸ãÔΡ£±ð
¸ö²»Ëµ£¬µ¥µ¥¾ÍѹËõÎļþΪÀý£¬ÎÒÃÇÖªµÀÔÚ
Windows
ÏÂ×î³£¼ûµÄѹËõÎļþ¾ÍÖ»ÓÐÁ½ÖÖ
£¬Ò»ÊÇ,zip£¬ÁíÒ»¸öÊÇ.rar¡£¿ÉÊÇLinux¾Í²»Í¬ÁË£¬ËüÓÐ.gz¡¢.tar.gz¡¢tgz¡¢bz2¡ ......

LinuxÉÏ´ò°üwgzºÍwgt widgetÏîÄ¿

shell½Å±¾Ô´Âë: widget.sh #!/bin/bash
####################±äÁ¿¶¨Òå####################
shellroot=/var/shell
shdir=${shellroot}/sh
source_dir=${shellroot}/source
tmp_dir=${shellroot}/temp
target_dir=${shellroot}/target
js_dir=${shellroot}/js
##################³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ