Linux ldconfigÏÂÁîÏê½â
Linux ldconfigÏÂÁîÏê½â
Ò»¡¢¸ÅÊö
ÔÚLinuxϵͳÖУ¬ldconfigÊÇÒ»¸öÓÃÓÚÉèÖù²Ïí¿âµÄÏÂÁî¡£ËüÓÃÓÚ¸üй²Ïí¿âµÄÁ´½Ó»ººÍ´æ£¬²¢Ê¹ÏµÍ³Äܹ»×¼È·¼ÓÔض¯Ì¬Á´½Ó¹²Ïí¿â¡£ldconfigµÄÖ÷Òª×÷ÓÃÊDzéÕÒ¶¯Ì¬Á´½Ó¿â²¢½¨Éè·ûºÅÁ´½ÓÒÔ¹©³ÌÐòʹÓᣱ¾ÎĽ«ÉîÈë̽ÌÖldconfigÏÂÁîµÄÓ÷¨ºÍÊÂÇéÔÀí£¬ÒÔ¼°Í¨¹ýÏêϸµÄ´úÂëʾÀýÀ´×ÊÖú¶ÁÕ߸üºÃµØÃ÷È·ldconfigµÄ¹¦Ð§¡£
¶þ¡¢ldconfigÏÂÁîµÄ»ù±¾Ó÷¨
ldconfigÏÂÁîµÄ»ù±¾Óï·¨ÈçÏ£º
ldconfig [OPTION]...
µÇ¼ºó¸´ÖÆ
Èý¡¢ldconfigÏÂÁîµÄ³£ÓÃÑ¡Ïî
-n, –print-cache£º´òÓ¡Ä¿½ñµÄ¹²Ïí¿â»º´æÄÚÈÝ¡£
-v, –verbose£ºÏÔʾÏêϸµÄÊä³öÐÅÏ¢¡£
-p, –format£ºÖ¸¶¨ldconfigµÄÊäÌØÊâʽ¡£
ËÄ¡¢Ê¾Àý´úÂë
1. Éó²é¹²Ïí¿â»º´æÄÚÈÝ
ldconfig -n
µÇ¼ºó¸´ÖÆ
2. ʹÓÃverboseÑ¡ÏîÉó²éÏêϸÐÅÏ¢
ldconfig -v
µÇ¼ºó¸´ÖÆ
3. Ç¿Öƽ¨Éè¹²Ïí¿â»º´æ
ldconfig -v -n /path/to/library
µÇ¼ºó¸´ÖÆ
Îå¡¢ldconfigÏÂÁîµÄÊÂÇéÔÀí
ldconfigÏÂÁîµÄÊÂÇéÁ÷³ÌÈçÏ£º
ldconfig¶ÁÈ¡/etc/ld.so.confºÍ/etc/ld.so.conf.dĿ¼ÏµÄÉèÖÃÎļþ£¬»ñÈ¡¹²Ïí¿âµÄËÑË÷·¾¶¡£
ldconfigɨÃèÕâЩ·¾¶ÏµĹ²Ïí¿âÎļþ£¬²¢½¨Éè·ûºÅÁ´½Ó¡£
ldconfig¸üй²Ïí¿â»º´æ£¬Ê¹ÏµÍ³Äܹ»×¼È·¼ÓÔض¯Ì¬Á´½Ó¹²Ïí¿â¡£
Áù¡¢×¢ÖØÊÂÏî
ÔÚ¸üй²Ïí¿âºó£¬Ó¦¸ÃÓÃldconfigÏÂÁîˢлº´æ£¬ÒÔʹϵͳÉúЧ¡£
ʹÓÃldconfigÏÂÁîÐèÒªÉóÉ÷²Ù×÷£¬ÒÔÃâ·ºÆðϵͳ¹ýʧ¡£
Æß¡¢×ܽá
ͨ¹ý±¾ÎĵÄÏÈÈÝ£¬¶ÁÕßÓ¦¸Ã¶ÔldconfigÏÂÁîÓÐÁ˸üÉîÈëµÄÃ÷È·¡£ldconfigÔÚLinuxϵͳÖÐÆð×ÅÖ÷ÒªµÄ×÷Óã¬Äܹ»×ÊÖúÓû§×¼È·¼ÓÔض¯Ì¬Á´½Ó¹²Ïí¿â¡£Í¨¹ý±¾ÎÄÌṩµÄ´úÂëʾÀý£¬¶ÁÕß¿ÉÒÔ¸üºÃµØѧϰºÍʹÓÃldconfigÏÂÁÌáÉýϵͳÖÎÀíµÄЧÂʺÍ׼ȷÐÔ¡£
Ô¸±¾ÎĶÔÄúÓÐËù×ÊÖú£¬Ð»Ð»ÔĶÁ£¡
ÒÔÉϾÍÊÇLinux ldconfigÏÂÁîÏê½âµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡