{"id":3245,"date":"2019-05-13T10:47:18","date_gmt":"2019-05-13T02:47:18","guid":{"rendered":"https:\/\/damogame.cn\/wordpress\/?p=3245"},"modified":"2019-05-13T10:47:18","modified_gmt":"2019-05-13T02:47:18","slug":"%e8%b0%88%e8%b0%88linux%e4%b8%8b%e5%8a%a8%e6%80%81%e5%ba%93%e6%9f%a5%e6%89%be%e8%b7%af%e5%be%84%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/3245","title":{"rendered":"\u8c08\u8c08Linux\u4e0b\u52a8\u6001\u5e93\u67e5\u627e\u8def\u5f84\u7684\u95ee\u9898"},"content":{"rendered":"<div class=\"tit0307_1\"><b class=\"yuanchuang\"><\/b><a href=\"http:\/\/blog.chinaunix.net\/uid-23069658-id-4028681.html\">\u00a0\u539f\u6587\u5730\u5740<\/a><\/div>\n<div class=\"tit0307_1\">\n<p>2013-12-08 23:30:22<\/p>\n<\/div>\n<div class=\"Blog_con2\">\n<div class=\"Blog_con3\"><\/div>\n<div class=\"Blog_wz1\">\u00a0 \u00a0\u00a0\u5b66\u4e60\u5230\u4e86\u4e00\u4e2a\u9636\u6bb5\u4e4b\u540e\uff0c\u5c31\u9700\u8981\u4e0d\u65ad\u7684\u603b\u7ed3\u3001\u6c89\u6dc0\u3001\u6e05\u96f6\uff0c\u7136\u540e\u624d\u80fd\u7ee7\u7eed\u201c\u4e0a\u8def\u201d\u3002\u56de\u60f3\u8d77\u81ea\u5df1\u5f53\u5e74\u521a\u63a5\u89e6Linux\u65f6\uff0c\u4e0d\u7ba1\u662f\u7528\u6e90\u7801\u5305\u7f16\u8bd1\u7a0b\u5e8f\uff0c\u8fd8\u662f\u7a0b\u5e8f\u8fd0\u884c\u65f6\u51fa\u73b0\u7684\u548c\u52a8\u6001\u5e93\u7684\u5404\u79cd\u6069\u6069\u6028\u6028\uff0c\u5fc3\u91cc\u90a3\u771f\u53eb\u4e00\u4e2a\u96be\u53d7\u3002\u90a3\u65f6\u5019\u8111\u888b\u91cc\u66fe\u7ecf\u4e5f\u72af\u8fc7\u5600\u5495\uff0c\u4e3a\u5565Linux\u4e0d\u5f04\u6210windows\u90a3\u6837\u5462\uff0c\u88c5\u4e2a\u8f6f\u4ef6\u90a3\u4e2a\u9ebb\u70e6\u4e0d\u8bf4\uff0c\u8fde\u8fd0\u884c\u8f6f\u4ef6\u90fd\u8fd9\u4e48\u607c\u706b\u5462\uff1f\u5982\u679c\u90a3\u6837\u7684\u8bdd\u5c31\u4e0d\u53ebLinux\u4e86\u3002\u501f\u7528\u5c0f\u7c73\u516c\u53f8CEO\u96f7\u519b\u4e00\u53e5\u8bdd\uff1a\u5c0f\u7c73\uff0c\u4e3a\u53d1\u70e7\u800c\u751f\u3002\u6211\u8ba4\u4e3a\uff1aLinux\uff0c\u4e3a\u771f\u7406\u800c\u5728\u3002\u7279\u522b\u662f\u4e3a\u90a3\u4e9b\u559c\u6b22\u6298\u817e\uff0c\u70ed\u8877\u6280\u672f\u80cc\u540e\u539f\u7406\u548c\u5b9e\u73b0\u7ec6\u8282\u7684\u4eba\u4eec\u800c\u751f\u3002<\/p>\n<p>\u8bf4\u5230\u548c\u52a8\u6001\u5e93\u67e5\u627e\u8def\u5f84\u76f8\u5173\u7684\u95ee\u9898\uff0c\u603b\u4f53\u4e0a\u53ef\u4ee5\u5206\u4e3a\u4e24\u7c7b\uff1a<br \/>\n\u7b2c\u4e00\u7c7b\uff1a\u901a\u8fc7\u6e90\u4ee3\u7801\u7f16\u8bd1\u7a0b\u5e8f\u65f6\u51fa\u73b0\u7684\u627e\u4e0d\u5230\u67d0\u4e2a\u4f9d\u8d56\u5305\u7684\u95ee\u9898\uff0c\u800c\u5982\u679c\u6b64\u65f6\u4f60\u6070\u597d\u5df2\u7ecf\u6309\u7167\u5b83\u7684\u8981\u6c42\u786e\u786e\u5b9e\u5b9e\u3001\u5343\u771f\u4e07\u786e\u3001\u5929\u5730\u826f\u5fc3\u5730\u628a\u4f9d\u8d56\u5e93\u7ed9\u88c5\u597d\u4e86\uff0c\u5b83\u8fd8\u7ed9\u4f60\u800d\u6df7\u3001\u72af\u4e8c\uff0c\u6709\u4e00\u80a1\u6298\u817e\u4e0d\u6b7b\u4eba\u4e0d\u507f\u547d\u7684\u52b2\u513f\uff0c\u90a3\u8ba9\u4eba\u771f\u662f\u6c14\u513f\u4e0d\u6253\u4e00\u5904\u6765\uff0c\u5982\u679cLinux\u6b64\u65f6\u6709\u5934\u6709\u8138\uff0c\u4f60\u662f\u4e0d\u662f\u7279\u60f3\u62bd\u5b83\u4e2b\u4e24\u5927\u5634\u5df4\uff1b<br \/>\n\u7b2c\u4e8c\u7c7b\uff1a\u5c31\u662f\u5728\u8fd0\u884c\u7a0b\u5e8f\u7684\u65f6\u5019\uff0c\u660e\u660e\u628a\u90a3\u4e2a\u7a0b\u5e8f\u9700\u8981\u7684\u4f9d\u8d56\u5305\u90fd\u5df2\u7ecf\u5b89\u88c5\u7684\u59a5\u59a5\u7684\u4e86\uff0c\u53ef\u8fd0\u884c\u7684\u65f6\u5019\u4eba\u5bb6\u5c31\u544a\u8bc9\u4f60\u8bf4\u201cerror while loading shared libraries:\u00a0<strong>libxxx<\/strong><strong>.so.y<\/strong>: cannot open shared object file: No such file or directory\u201d\uff0c\u4efb\u51ed\u4f60\u600e\u4e48\u6298\u817e\u90fd\u6ca1\u7528\u3002\u6b64\u65f6\u4f60\u8981\u662f\u5fc3\u60f3\u201c\u64a4\u5427\uff0c\u54e5\u4eec\uff0cLinux\u592aTM\u6b3a\u8d1f\u4eba\u4e86\uff0c\u4e0d\u5e26\u8fd9\u4e48\u73a9\u513f\u7684\u201d\uff0c\u90a3\u4f60\u5c31\u5927\u9519\u7279\u9519\u4e86\uff0c\u53ea\u8981\u4f60\u62b1\u7740\u201c\u7f8e\u597d\u7684\u4e8b\u60c5\u7684\u603b\u4f1a\u53d1\u751f\u201d\u548c\u201c\u529e\u6cd5\u6c38\u8fdc\u6bd4\u95ee\u9898\u591a\u201d\u7684\u4fe1\u5ff5\u575a\u6301\u4e0b\u53bb\uff0c\u4f60\u5c31\u4e00\u5b9a\u4f1a\u6210\u529f\u3002\u8bdd\u7684\u610f\u601d\u6709\u70b9\u81ea\u6b3a\u6b3a\u4eba\uff0c\u7cbe\u795e\u9e26\u7247\u7684\u5473\u9053\u5728\u91cc\u9762\uff0c\u4f46\u786e\u5b9e\u662f\u8fd9\u4e48\u4e2a\u7406\u513f\u3002<\/p>\n<p>\u4e0a\u9762\u4e24\u7c7b\u95ee\u9898\u6700\u5927\u7684\u539f\u56e0\u5c31\u662f\uff0c\u4f60\u6ca1\u5f04\u767d\u5b83\u4eec\u7684\u673a\u5236\u548c\u539f\u7406\u3002\u4f60\u770b\u5230\u7684\u53ea\u662f\u73b0\u8c61\uff0c\u5f53\u5e74\u5b66\u9a6c\u514b\u601d\u4e3b\u4e49\u4e3b\u4e49\u54f2\u5b66\u539f\u7406\u7684\u65f6\u5019\uff0c\u8001\u5e08\u600e\u4e48\u6559\u5bfc\u6211\u4eec\u7684\uff1f\u8981\u900f\u8fc7\u73b0\u8c61\u770b\u672c\u8d28\u3002\u5982\u679c\u4f60\u628a\u4e0a\u9762\u4e24\u4e2d\u5e94\u7528\u7684\u539f\u7406\u641e\u6e05\u4e86\uff0c\u90a3\u95ee\u9898\u4e0d\u5c31\u81ea\u7136\u800c\u7136\u7684\u8fce\u5203\u800c\u89e3\u4e86\u4e48\u3002\u4e0b\u9762\u54b1\u4eec\u5c31\u4e00\u4e00\u63a2\u8ba8\u4e00\u4e0b\u8fd9\u4e24\u4e2a\u95ee\u9898\uff0c\u4ee5\u4fbf\u5bf9\u65b0\u8fdb\u5b66\u4e60Linux\u7684\u670b\u53cb\u4eec\u8d77\u4e00\u4e2a\u7684\u53c2\u8003\u8d44\u6599\u7684\u4f5c\u7528\u3002<\/p>\n<p>\u95ee\u98981\uff1a\u901a\u8fc7\u6e90\u4ee3\u7801\u5b89\u88c5\u7a0b\u5e8f<br \/>\n\u901a\u8fc7\u6e90\u7801\u5305\u5b89\u88c5\u7a0b\u5e8f\u65f6\uff0c\u4e3b\u8981\u7528\u5230\u4e86\u201c\u4e09\u5927\u6b65\u201d\u7b56\u7565\uff1aconfigure\u3001make\u548cmake install \u3002\u51fa\u95ee\u9898\u6700\u591a\u7684\u5c31\u662f\u5728configure\u9636\u6bb5\uff0c\u5f88\u591a\u521d\u5b66\u8005\u7531\u4e8e\u4e0d\u77e5\u9053configure\u7684\u90a3\u4e48\u591a\u53c2\u6570\u8be5\u600e\u4e48\u7528\uff0c\u6240\u4ee5\u5f80\u5f80\u4e3a\u4e86\u7701\u4e8b\uff0c\u4e00\u53e5\u7b80\u5355\u7684\u201c.\/configure\u201d\u4e0b\u53bb\uff0c\u767e\u5206\u4e4b\u516b\u4e5d\u5341\u90fd\u80fd\u6210\u529f\uff0c\u53ef\u95ee\u9898\u5f80\u5f80\u5c31\u51fa\u5728\u5269\u4e0b\u7684\u767e\u5206\u4e4b\u5341\u51e0\u4e0a\u9762\u4e86\u3002\u8fd9\u8ba9\u6211\u4eec\u53c8\u4e00\u6b21\u76f8\u4fe1\u4e86\uff0c\u5c0f\u6982\u7387\u4e8b\u4ef6\u7684\u53d1\u751f\u5bf9\u4e8b\u60c5\u7684\u5f71\u54cd\u662f\u591a\u4e48\u7684\u6df1\u8fdc\u3002\u5728\u5b89\u88c5\u7684configure\u9636\u6bb5\uff0c\u4e3a\u4e86\u68c0\u6d4b\u5b89\u88c5\u5b89\u88c5\u73af\u5883\u662f\u5426\u6ee1\u8db3\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\u90fd\u662f\u901a\u8fc7\u4e00\u4e2a\u53eb\u505apkg-config\u7684\u5de5\u5177\u6765\u68c0\u6d4b\u5b83\u9700\u8981\u4f9d\u8d56\u7684\u52a8\u6001\u5e93\u662f\u5426\u5b58\u5728\uff0c\u8fd9\u4e2a\u5de5\u5177\u6211\u4eec\u5728\u4e0a\u4e00\u7bc7\u535a\u6587\u5df2\u7ecf\u8ba4\u8bc6\u8fc7\u4e86\u3002pkg-config\u901a\u5e38\u60c5\u51b5\u90fd\u662f\u4f4d\u4e8e\/usr\/bin\u76ee\u5f55\u4e0b\uff0c\u662f\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f\u3002\u5728configure\u9636\u6bb5\uff0c\u901a\u5e38\u90fd\u4f1a\u7528pkg-config\u6765\u5224\u65ad\u6240\u4f9d\u8d56\u7684\u52a8\u6001\u5e93\u662f\u5426\u5b58\u5728\u3002\u73b0\u5728\u95ee\u9898\u5c31\u662f\uff0c\u8fd9\u4e2a\u5de5\u5177\u662f\u5982\u4f55\u5224\u65ad\u7684\u5462\uff1f\u5b83\u7684\u4f9d\u636e\u662f\u4ec0\u4e48\uff1f\u5f53\u8fd9\u4e24\u4e2a\u95ee\u9898\u5f04\u660e\u767d\u4e86\uff0c\u771f\u76f8\u4e5f\u5c31\u5927\u767d\u4e86\u3002<\/p>\n<p>\u4e00\u822c\u5f53\u6211\u4eec\u5b89\u88c5\u5b8c\u67d0\u4e2a\u7a0b\u5e8f\u540e\uff0c\u5982\u679c\u5b83\u63d0\u4f9b\u4e86\u52a8\u6001\u5e93\u7684\u529f\u80fd\uff0c\u5728\u6e90\u7801\u4e2d\u90fd\u4f1a\u6709\u4e00\u4e2a\u6216\u591a\u4e2a\u4ee5pc\u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u5f53\u6267\u884c\u5b8cmake install\u540e\u8fd9\u4e9bpc\u6587\u4ef6\u62f7\u8d1d\u5230${prefix}\/lib\/pkgconfig\u8fd9\u4e2a\u76ee\u5f55\u91cc\uff0c\u8fd9\u91cc\u7684prefix\u5c31\u662f\u6211\u4eec\u5728configure\u9636\u6bb5\u65f6\u901a\u8fc7\u914d\u7f6e\u53c2\u6570&#8211;prefix\u6307\u5b9a\u7684\uff0c\u7f3a\u7701\u60c5\u51b5\u8fd9\u4e2a\u503c\u5c31\u662f\/usr\/local\uff0c\u6240\u4ee5\u8fd9\u4e9bpc\u6587\u4ef6\u6700\u7ec8\u4f1a\u88ab\u62f7\u8d1d\u5230\/usr\/local\/lib\/pkgconfig\u76ee\u5f55\u4e0b\u3002\u53ef\u80fd\u6709\u4eba\u4f1a\u95ee\uff0c\u8fd9\u4e9bpc\u6587\u4ef6\u6709\u5565\u7528\u5462\uff1f\u6211\u4eec\u968f\u4fbf\u6253\u5f00\u4e00\u4e2a\u6765\u7785\u7785\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>[root@localhost ~]# cat \/usr\/local\/lib\/pkgconfig\/librtmp.pc<br \/>\nprefix=\/usr\/local<br \/>\nexec_prefix=${prefix}<br \/>\nlibdir=${exec_prefix}\/lib<br \/>\nincdir=${prefix}\/include<\/p>\n<p>Name: librtmp<br \/>\nDescription: RTMP implementation<br \/>\nVersion: v2.3<br \/>\nRequires: libssl,libcrypto<br \/>\nURL: http:\/\/rtmpdump.mplayerhq.hu<br \/>\nLibs: -L${libdir} -lrtmp -lz<br \/>\nCflags: -I${incdir}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8ddf\u6211\u4eecconfigure\u9636\u6bb5\u76f8\u5173\u7684\u4e3b\u8981\u96c6\u4e2d\u5728Libs\u548cCflags\u4e24\u9879\u4e0a\u9762\uff0c\u5982\u679c\u4f60\u6b64\u65f6\u518d\u6267\u884c\u4e0b\u9762\u8fd9\u4e24\u6761\u547d\u4ee4\uff0c\u5c31\u5168\u660e\u767d\u4e86\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>[root@localhost ~]# pkg-config &#8211;cflags librtmp<br \/>\n-I\/usr\/local\/include<br \/>\n[root@localhost ~]# pkg-config &#8211;libs librtmp<br \/>\n-L\/usr\/local\/lib -lrtmp -lz -lssl -lcrypto<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0cpkg-config\u628a\u6211\u4eec\u4ee5\u524d\u9700\u8981\u5728Makefile\u91cc\u6307\u5b9a\u7f16\u8bd1\u548c\u94fe\u63a5\u65f6\u6240\u9700\u8981\u7528\u5230\u7684\u53c2\u6570\u4ece\u624b\u5de5\u786c\u7f16\u7801\u7684\u6a21\u5f0f\u53d8\u6210\u4e86\u81ea\u52a8\u5b8c\u6210\uff0c\u8282\u7ea6\u4e86\u591a\u5c11\u8de8\u5e73\u53f0\u79fb\u690d\u7684\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u6211\u4eec\u662f\u4e0d\u662f\u5f97\u611f\u8c22\u4eba\u5bb6\u5341\u516b\u8f88\u513f\u7956\u5b97\u3002\u5047\u5982\u8bf4\uff0c\u5982\u679c\u6211\u4eec\u5c06\u8981\u7684\u7f16\u8bd1\u7684\u8f6f\u4ef6\u5305\u4f9d\u8d56librtmp\u8fd9\u4e2a\u52a8\u6001\u5e93\uff0c\u90a3\u4e48\u6b64\u65f6\u5728\u6211\u7cfb\u7edf\u4e0a\u8fd9\u4e2a\u68c0\u6d4b\u5c31\u7b97\u901a\u8fc7\u4e86\u3002\u5f53\u7136\u8fd9\u53ea\u662f\u7b2c\u4e00\u6b65\uff0c\u68c0\u6d4b\u8fc7\u4e86\u4e0d\u4e00\u5b9a\u517c\u5bb9\uff0c\u8fd9\u91cc\u6211\u4eec\u53ea\u8ba8\u8bba\u80fd\u4e0d\u80fd\u627e\u5230\u4f9d\u8d56\u5e93\u7684\u95ee\u9898\uff0c\u517c\u5bb9\u6027\u95ee\u9898\u90a3\u90fd\u4e0d\u662f\u4e2a\u4e8b\u513f\uff0c\u4eba\u5bb6\u8981\u5565\u7248\u672c\u4f60\u597d\u751f\u4f3a\u5019\u5c31\u662f\u4e86\uff0c\u8fd9\u4e2a\u6ca1\u5f97\u5546\u91cf\uff0c\u6700\u597d\u4e5f\u4e0d\u8981\u5546\u91cf\uff0c\u7ae5\u53df\u65e0\u6b3a\uff0c\u4e0d\u7136\u540e\u679c\u5f88\u4e25\u91cd\u3002\u597d\u4e86\uff0c\u5982\u679c\u8bf4\u627e\u4e0d\u5230\u67d0\u4e2a\u5e93\u8be5\u600e\u4e48\u529e\u3002\u524d\u63d0\u662f\u4f60\u786e\u786e\u5b9e\u5b9e\u5df2\u7ecf\u5b89\u88c5\u4e86\u5b83\u9700\u8981\u7684\u5e93\uff0c\u4e0d\u7528\u591a\u60f3\uff0c\u539f\u56e0\u53ea\u6709\u4e00\u4e2a\uff0cpkg-config\u627e\u4e0d\u5230\u8fd9\u4e2a\u4e0e\u8fd9\u4e2a\u5e93\u5bf9\u5e94\u7684pc\u6587\u4ef6\u3002\u4e3a\u4ec0\u4e48\u4f1a\u627e\u4e0d\u5230\u5462\uff0c\u539f\u56e0\u53c8\u6709\u4e24\u70b9\uff1a<br \/>\n1\u3001pkg-config\u641c\u7d22\u4e86\u6240\u6709\u5b83\u8ba4\u4e3a\u5408\u9002\u7684\u76ee\u5f55\u90fd\u6ca1\u627e\u7740\u8fd9\u4e2a\u5e93\u5bf9\u5e94\u7684pc\u6587\u4ef6\u7684\u4e0b\u843d\uff1b<br \/>\n2\u3001\u8fd9\u4e2a\u5e93\u5728\u53d1\u5e03\u65f6\u6839\u672c\u5c31\u6ca1\u6709\u63d0\u4f9b\u5b83\u7684pc\u6587\u4ef6\u3002<br \/>\n\u8fd9\u91cc\uff0c\u6211\u4eec\u4e25\u91cd\u201c\u6297\u8bae\u3001\u9119\u89c6+\u62b5\u5236\u201d\u7b2c\u4e8c\u79cd\u60c5\u51b5\u7684\u8f6f\u4ef6\u5305\uff0c\u800c\u4e14\u4e5f\u5c3d\u91cf\u4e0d\u8981\u5b83\uff0c\u4e00\u4e2a\u51fa\u6765\u6df7\u90fd\u4e0d\u81ea\u62a5\u5bb6\u95e8\u7684\u5bb6\u4f19\uff0c\u80af\u5b9a\u4e5f\u597d\u4e0d\u5230\u54ea\u91cc\u53bb\u3002\u90a3\u4e48\uff0c\u73b0\u5728\u95ee\u9898\u5c31\u53ea\u5269\u4e0b\u4e00\u4e2a\u4e86\uff1apkg-config\u7684\u67e5\u627e\u8def\u5f84\u662f\u54ea\u91cc\uff1f<\/p>\n<p>pkg-config\u8f83\u8001\u7684\u7248\u672c\u91cc\uff0c\u7f3a\u7701\u60c5\u51b5\u4e0b\u4f1a\u5230\/usr\/lib\/pkgconfig\u3001\/usr\/loca\/lib\/pkgconfig\u3001\/usr\/share\/pkgconfig\u7b49\u76ee\u5f55\u4e0b\u53bb\u641c\u7d22pc\u6587\u4ef6\uff0c\u636e\u6211\u6240\u77e5\u57280.23\u4ee5\u53ca\u4e4b\u540e\u7684\u7248\u672c\u91ccpkg-config\u7684\u6e90\u7801\u91cc\u5df2\u7ecf\u6ca1\u6709\u5173\u4e8e\u7f3a\u7701\u641c\u7d22\u8def\u5f84\u7684\u4efb\u4f55\u786c\u7f16\u7801\u7684\u6210\u5206\u4e86\uff0c\u81f3\u4e8e\u5177\u4f53\u4ece\u54ea\u4e2a\u7248\u672c\u5f00\u59cb\u6211\u4e5f\u6ca1\u6709\u53bb\u8ffd\u7a76\uff0c\u8fd8\u671b\u6709\u77e5\u9053\u7684\u670b\u53cb\u5206\u4eab\u4e00\u4e0b\u3002\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\uff0c\u5f53\u4f60\u770bpkg-config\u7684man\u624b\u518c\u65f6\u4f1a\u6709\u4e0b\u9762\u4e00\u6bb5\u8bdd\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>pkg-config retrieves information about packages from special metadata files. These files are \u00a0named \u00a0after\u00a0the \u00a0package, \u00a0with \u00a0the extension .pc.<br \/>\nBy default, pkg-config looks in the directory\u00a0<strong>prefix\/lib\/pkgconfig<\/strong>\u00a0for these files; it will also look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4ee5\u53ca\u8fd9\u70b9\u8865\u5145\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>PKG_CONFIG_PATH<br \/>\nA colon-separated (on Windows, semicolon-separated) list of directories to search \u00a0for \u00a0.pc \u00a0files.\u00a0The \u00a0default directory will always be searched after searching the path; the default is\u00a0<strong>libdir\/pkg-<\/strong><strong>config:datadir\/pkgconfig<\/strong>\u00a0where libdir is the libdir where pkg-config and \u00a0datadir \u00a0is \u00a0the \u00a0datadir\u00a0where pkg-config was installed.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e0a\u9762\u63d0\u5230\u7684prefix\u3001libdir\u548cdatadir\uff0c\u5c31\u662f\u5b89\u88c5pkg-config\u65f6\u88ab\u8bbe\u5b9a\u597d\u7684\uff0c\u5177\u4f53\u60c5\u51b5\u662f\uff1a<br \/>\n1\u3001\u5982\u679c\u4f60\u662f\u901a\u8fc7yum\u548crpm\u5305\u5b89\u88c5\u7684<br \/>\nprefix=\/usr<br \/>\nlibdir=${prefix}\/lib=\/usr\/lib<br \/>\ndatadir=${prefix}\/share=\/usr\/share<br \/>\n2\u3001\u5982\u679c\u4f60\u662f\u901a\u8fc7\u6e90\u7801\u5305\u5b89\u88c5\u7684\uff0c\u4e14\u6ca1\u6709\u6307\u5b9aprefix\u7684\u503c(\u6307\u5b9a\u7684\u60c5\u51b5\u540c1)<br \/>\nprefix=\/usr\/local<br \/>\nlibdir=${prefix}\/lib=\/usr\/local\/lib<br \/>\ndatadir=${prefix}\/share=\/usr\/local\/share<\/p>\n<p>pkg-config\u5728\u67e5\u627e\u5bf9\u5e94\u8f6f\u4ef6\u5305\u7684\u4fe1\u606f\u65f6\u7684\u7f3a\u7701\u641c\u7d22\u8def\u5f84\u5df2\u7ecf\u5f88\u6e05\u695a\u4e86\uff0c\u6709\u4e00\u70b9\u5199\u9519\u4e86\uff0c\u4e0d\u662f${libdir}\/pkg-config\uff0c\u800c\u5e94\u8be5\u662f${libdir}\/pkgconfig\u548c${datadir}\/pkgconfig\u3002\u5982\u679c\u4f60\u8f6f\u4ef6\u5305\u5bf9\u5e94\u7684pc\u6587\u4ef6\u90fd\u4e0d\u5728\u8fd9\u4e24\u4e2a\u76ee\u5f55\u4e0b\u65f6\uff0cpkg-config\u80af\u5b9a\u627e\u4e0d\u5230\u3002\u65e2\u7136\u539f\u56e0\u90fd\u5df2\u7ecf\u627e\u5230\u4e86\uff0c\u90a3\u89e3\u51b3\u529e\u6cd5\u4e5f\u5c31\u591a\u79cd\u591a\u6837\u4e86\u3002<br \/>\n<strong>\u65b9\u6848\u4e00<\/strong>\uff1a\u6211\u4eec\u53ef\u4ee5\u5728\u5b89\u88c5\u6211\u4eec\u90a3\u4e2a\u88ab\u4f9d\u8d56\u7684\u8f6f\u4ef6\u5305\u65f6\uff0c\u5728configure\u9636\u6bb5\u7528&#8211;prefix\u53c2\u6570\u628a\u5b89\u88c5\u76ee\u5f55\u6307\u5b9a\u5230\/usr\u76ee\u5f55\u4e0b\uff1b<br \/>\n<strong>\u65b9\u6848\u4e8c<\/strong>\uff1a\u4e5f\u53ef\u4ee5\u6309\u7167\u4e0a\u9762\u8bf4\u7684\uff0c\u901a\u8fc7\u4e00\u4e2a\u540d\u53ebPKG_CONFIG_PATH\u7684\u73af\u5883\u53d8\u91cf\u6765\u5411pkg-config\u6307\u660e\u6211\u4eec\u81ea\u5df1\u7684pc\u6587\u4ef6\u6240\u5728\u7684\u8def\u5f84\uff0c\u4e0d\u8fc7\u8981\u6ce8\u610f\u7684\u662fPKG_CONFIG_PATH\u6240\u6307\u5b9a\u7684\u8def\u5f84\u4f18\u5148\u7ea7\u6bd4\u8f83\u9ad8\uff0cpkg-config\u4f1a\u5148\u8fdb\u884c\u641c\u7d22\uff0c\u5b8c\u4e86\u4e4b\u540e\u624d\u662f\u53bb\u641c\u7d22\u7f3a\u7701\u8def\u5f84\u3002<br \/>\n\u524d\u8005\u7684\u4f18\u70b9\u662f\u4ee5\u540e\u518d\u901a\u8fc7\u6e90\u7801\u5b89\u88c5\u8f6f\u4ef6\u65f6\u5c11\u4e86\u4e0d\u5c11\u9ebb\u70e6\uff0c\u7f3a\u70b9\u662f\u7528\u6237\u81ea\u5df1\u7684\u8f6f\u4ef6\u5305\u548c\u7cfb\u7edf\u8f6f\u4ef6\u6df7\u5230\u4e00\u8d77\u4e0d\u65b9\u4fbf\u7ba1\u7406\uff0c\u6240\u4ee5\u5b9e\u9645\u4f7f\u7528\u4e2d\uff0c\u540e\u8005\u7528\u7684\u8981\u591a\u4e00\u4e9b\u3002<\/p>\n<p>\u65b9\u6848\u4e8c\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\u6709\u4e24\u79cd\u5b9e\u73b0\u65b9\u5f0f\uff1a<br \/>\n1\u3001\u9488\u5bf9\u6ca1\u6709root\u6743\u9650\u7684\u60c5\u51b5\uff0c\u5927\u591a\u6570\u60c5\u51b5\u90fd\u662f\u6267\u884c\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>export PKG_CONFIG_PATH=\/your\/local\/path:$PKG_CONFIG_PATH<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7136\u540e\uff0c\u5728configure\u65f6\u5c31\u7edd\u5bf9\u6ca1\u95ee\u9898\u4e86\u3002<br \/>\n2\u3001\u5728\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u4e0b\u7684.bash_profile\u6587\u4ef6\u91cc\u6216\u7cfb\u7edf\u6587\u4ef6\/etc\/profile\u7684\u672b\u5c3e\u6dfb\u52a0\u4e0a\u9762\u4e00\u884c\u4e5f\u6210\uff0c\u90fd\u53ef\u4ee5\u3002<br \/>\n\u81f3\u6b64\uff0c\u52a8\u6001\u5e93\u67e5\u627e\u95ee\u9898\u7684\u7b2c\u4e00\u79cd\u60c5\u51b5\u5c31\u5f7b\u5e95\u89e3\u51b3\u4e86\u3002\u60f3\u4e86\u89e3pc\u6587\u4ef6\u7684\u66f4\u591a\u7ec6\u8282\u7684\uff0c\u53ef\u4ee5\u53c2\u8003<a href=\"http:\/\/people.freedesktop.org\/~dbn\/pkg-config-guide.html\">http:\/\/people.freedesktop.org\/~dbn\/pkg-config-guide.html<\/a>\u00a0\uff1b \u60f3\u5b66\u4e60pkg-config\u5de5\u5177\u66f4\u591a\u7528\u6cd5\u7684\u670b\u53cb\u5efa\u8bae\u770bman\u624b\u518c\u3002<\/p>\n<p><strong>\u95ee\u98982\uff1a\u7a0b\u5e8f\u8fd0\u884c\u65f6\u51fa\u73b0libxxx.so.y =&gt;\u00a0not found<\/strong><br \/>\n\u8fd9\u79cd\u60c5\u51b5\uff0c\u5728\u6211\u4ee5\u524d\u7684\u535a\u6587\u201c<a href=\"http:\/\/blog.chinaunix.net\/uid-23069658-id-3142046.html\" target=\"_blank\" rel=\"noopener noreferrer\">Linux\u7cfb\u7edf\u4e0b\u52a8\u6001\u5e93\u548c\u9759\u6001\u5e93\u90a3\u70b9\u4e8b\u513f<\/a>\u201d\u91cc\u5df2\u7ecf\u63d0\u5230\u4e00\u90e8\u5206\uff0c\u8fd9\u91cc\u5c31\u628a\u5b83\u8865\u5145\u5b8c\u6574\u3002\u5728\u90a3\u7bc7\u535a\u6587\u91cc\uff0c\u6211\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u6216\u8005\u201cldconfig\u00a0<em><strong>\u52a8\u6001\u5e93\u6240\u5728\u8def\u5f84<\/strong><\/em>\u201d\u7684\u65b9\u5f0f\u89e3\u51b3\u7684\uff0c\u4e5f\u662f99%\u7684\u573a\u5408\u4e0b\u7684\u89e3\u51b3\u529e\u6cd5\uff0c\u90a3\u662f\u9488\u5bf9\u6709root\u6743\u9650\u7684\u7528\u6237\u7684\u89e3\u51b3\u529e\u6cd5\u3002\u6ca1\u6709root\u6743\u9650\u8fd0\u884c\u8f6f\u4ef6\u65f6\uff0cLinux\u4e5f\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e2a\u540d\u4e3aLD_LIBRARY_PATH\u7684\u73af\u5883\u53d8\u91cf\u6765\u89e3\u51b3\u8fd0\u884c\u65f6\u52a8\u6001\u5e93\u67e5\u627e\u8def\u5f84\u7684\u89e3\u51b3\u65b9\u6848\u3002\u540c\u6837\u5730\uff0c\u7531\u8fd9\u4e2a\u73af\u5883\u53d8\u91cf\u6240\u6307\u5b9a\u7684\u8def\u5f84\u4f1a\u88ab\u88c5\u8f7d\u5668\/lib\/ld-2.12.so\u4f18\u5148\u67e5\u627e\uff0c\u7136\u540e\u624d\u662f\u52a8\u6001\u5e93\u5e93\u7f13\u5b58\u6587\u4ef6\/etc\/ld.so.cache\uff0c\u98ce\u91c7\u77ac\u95f4\u5c31\u88abLD_LIBRARY_PATH\u7ed9\u62a2\u5b8c\u4e86\uff0c\/etc\/ld.so.cache\u8868\u793a\u5f88\u4e0d\u9ad8\u5174\u3002\u9488\u5bf9LD_LIBRARY_PATH\u73af\u5883\u53d8\u91cf\u8fd9\u79cd\u60c5\u51b5\uff0c\u7edd\u5bf9\u662f\u4e34\u65f6\u4e0d\u80fd\u518d\u4e34\u65f6\u89e3\u51b3\u65b9\u6848\u4e86\uff0c\u5982\u679c\u53ea\u662f\u6d4b\u8bd5\u7528\uff0c\u7528export\u50cf\u89e3\u51b3PKG_CONFIG_PATH\u4e00\u6837\u7684\u65b9\u5f0f\u5e72\u51c0\u5229\u7d22\u5c31\u884c\u4e86\uff0c<strong>\u5343\u4e07\u4e0d\u8981\u5728\u5b9e\u9645\u751f\u4ea7\u4e0a\u7ebf\u7684\u8fd0\u7ef4\u73af\u5883\u91cc\u628a\u201cexport\u00a0LD_LIBRARY_PATH=&#8230;\u201d \u6dfb\u52a0\u5230<\/strong><strong>.bash_profile\u6216\u8005<\/strong><strong>\/etc\/profile\u91cc<\/strong>\uff0c\u4e0d\u7136\u5230\u65f6\u5019\u6094\u5f97\u4f60\u80a0\u5b50\u90fd\u7eff\u4e86\u4e0d\u53ef\u3002<\/p>\n<p>\u5176\u5b9ePKG_CONFIG_PATH\u548cLD_LIBRARY_PATH\u7ecf\u5e38\u88ab\u5f88\u591a\u4eba\u8bef\u7528\uff0c\u7279\u522b\u662f\u65b0\u624b\u4eec\u5728\u89e3\u51b3\u95ee\u9898\u65f6\uff0c\u4e5f\u4e0d\u5206\u9752\u7ea2\u7682\u767d\uff0c\u902e\u7740\u4e86\u5c31\u662f\u4e00\u987f\u72c2export\uff0c\u6839\u636e\u5b9e\u9645\u573a\u5408\uff0c\u8fd0\u6c14\u597d\u4e86\u8bf4\u4e0d\u5b9a\u95ee\u9898\u8fd8\u771f\u5c31\u89e3\u51b3\uff0c\u70b9\u513f\u80cc\u4e86\u6298\u817e\u4e00\u5929\u534a\u5bbf\u4e5f\u662f\u767d\u5fd9\u6d3b\u3002\u5176\u5b9e\u8981\u662f\u7559\u70b9\u5fc3\uff0c\u8fd8\u662f\u633a\u5bb9\u6613\u660e\u767d\u7684\uff1a<br \/>\nPKG_CONFIG_PATH\u4ece\u5b57\u9762\u610f\u601d\u4e0a\u7ffb\u8bd1\uff0c\u5c31\u662f\u201c\u8f6f\u4ef6\u5305\u7684\u914d\u7f6e\u8def\u5f84\u201d\uff0c\u8fd9\u4e0d\u5f88\u660e\u663e\u4e86\u4e48\uff0c\u7f16\u8bd1\u8f6f\u4ef6\u65f6\u5982\u679c\u51fa\u73b0\u627e\u4e0d\u5230\u6240\u4f9d\u8d56\u7684\u52a8\u6001\u5e93\u65f6\u90fd\u5168\u9760PKG_CONFIG_PATH\u4e86\uff1b<br \/>\nLD_LIBRARY_PATH\u4e5f\u5f88\u76f4\u767d\u4e86\u201c\u88c5\u8f7d\u5668\u7684\u5e93\u8def\u5f84\u201d\uff0cLD\u662fLoader\u7684\u7b80\u5199\uff0c\u5728\u535a\u6587\u201c<a href=\"http:\/\/blog.chinaunix.net\/uid-23069658-id-3959636.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u6bb5\u9519\u8bef\u5230\u5e95\u662f\u4f55\u65b9\u5996\u5b7d<\/a>\u201d\u91cc\u6211\u4e5f\u66fe\u63d0\u5230\u8fc7\uff0c\u5728Linux\u7cfb\u7edf\u542f\u52a8\u4e00\u4e2a\u7a0b\u5e8f\u7684\u8fc7\u7a0b\u5c31\u53eb\u505a\u88c5\u8f7d\uff0c\u4e00\u4e2a\u7a0b\u5e8f\u8981\u6267\u884c\u65f6\u5b83\u6216\u591a\u6216\u5c11\u7684\u4f1a\u4f9d\u8d56\u4e00\u4e9b\u52a8\u6001\u5e93(\u9759\u6001\u7f16\u8bd1\u7684\u9664\u5916)\u3002\u5f53\u4f60\u7528\u201cldd\u00a0<em><strong>\u53ef\u6267\u884c\u7a0b\u5e8f\u540d<\/strong><\/em>\u201d\u67e5\u770b\u4e00\u4e2a\u8f6f\u4ef6\u542f\u52a8\u65f6\u6240\u4f9d\u8d56\u7684\u52a8\u6001\u5e93\uff0c\u5982\u679c\u8f93\u51fa\u9879\u6709\u201clibxxx.so.y=&gt; not found\u201d\u4e00\u9879\uff0c\u4f60\u8fd9\u4e2a\u8f6f\u4ef6100%\u8fd0\u884c\u4e0d\u8d77\u6765\u3002<\/p>\n<p>\u4e0d\u4fe1\u6211\u4eec\u6765\u505a\u4e2a\u8bd5\u9a8c\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>[root@localhost ~]# echo $LD_LIBRARY_PATH \u00a0 \u00a0\/\/\u561b\u4e5f\u6ca1\u6709<\/p>\n<p>[root@localhost ~]# ldd \/usr\/local\/bin\/ffmpeg<br \/>\nlinux-gate.so.1 =&gt; \u00a0(0x00914000)<br \/>\nlibavdevice.so.54 =&gt; \/usr\/local\/lib\/libavdevice.so.54 (0x007d0000)<br \/>\nlibavfilter.so.3 =&gt; \/usr\/local\/lib\/libavfilter.so.3 (0x001f3000)<br \/>\nlibavformat.so.54 =&gt; \/usr\/local\/lib\/libavformat.so.54 (0x002b5000)<br \/>\nlibavcodec.so.54 =&gt; \/usr\/local\/lib\/libavcodec.so.54 (0xb68dd000)<br \/>\nlibpostproc.so.52 =&gt; \/usr\/local\/lib\/libpostproc.so.52 (0x0083c000)<br \/>\nlibswresample.so.0 =&gt; \/usr\/local\/lib\/libswresample.so.0 (0x00a91000)<br \/>\nlibswscale.so.2 =&gt; \/usr\/local\/lib\/libswscale.so.2 (0x00d80000)<br \/>\nlibavutil.so.52 =&gt; \/usr\/local\/lib\/libavutil.so.52 (0x001a7000)<br \/>\nlibm.so.6 =&gt; \/lib\/libm.so.6 (0x0058b000)<br \/>\nlibpthread.so.0 =&gt; \/lib\/libpthread.so.0 (0x001d7000)<br \/>\nlibc.so.6 =&gt; \/lib\/libc.so.6 (0x005e2000)<br \/>\nlibasound.so.2 =&gt; \/lib\/libasound.so.2 (0x00ec5000)<br \/>\nlibdc1394.so.22 =&gt; \/usr\/local\/lib\/libdc1394.so.22 (0x00116000)<br \/>\nlibrt.so.1 =&gt; \/lib\/librt.so.1 (0x00184000)<br \/>\nlibfreetype.so =&gt; \/usr\/local\/lib\/libfreetype.so (0x00411000)<br \/>\nlibass.so.4 =&gt; \/usr\/local\/lib\/libass.so.4 (0x0091a000)<br \/>\nlibssl.so.1.0.0 =&gt; \/usr\/local\/lib\/libssl.so.1.0.0 (0x0048c000)<br \/>\nlibcrypto.so.1.0.0 =&gt; \/usr\/local\/lib\/libcrypto.so.1.0.0 (0x00aa8000)<br \/>\nlibrtmp.so.0 =&gt; \/usr\/local\/lib\/librtmp.so.0 (0x009dd000)<br \/>\nlibz.so.1 =&gt; \/lib\/libz.so.1 (0x0018d000)<br \/>\nlibx264.so.132 =&gt; \/usr\/local\/lib\/libx264.so.132 (0x00fb1000)<br \/>\nlibvorbisenc.so.2 =&gt; \/usr\/local\/lib\/libvorbisenc.so.2 (0x0194d000)<br \/>\nlibvorbis.so.0 =&gt; \/usr\/local\/lib\/libvorbis.so.0 (0x004e5000)<br \/>\nlibvo-aacenc.so.0 =&gt; \/usr\/local\/lib\/libvo-aacenc.so.0 (0x00799000)<br \/>\nlibtwolame.so.0 =&gt; \/usr\/local\/lib\/libtwolame.so.0 (0x0050d000)<br \/>\nlibtheoraenc.so.1 =&gt; \/usr\/local\/lib\/libtheoraenc.so.1 (0x0052d000)<br \/>\nlibtheoradec.so.1 =&gt; \/usr\/local\/lib\/libtheoradec.so.1 (0x00779000)<br \/>\nlibspeex.so.1 =&gt; \/usr\/local\/lib\/libspeex.so.1 (0x00c94000)<br \/>\nlibmp3lame.so.0 =&gt; \/usr\/local\/lib\/libmp3lame.so.0 (0x0088c000)<br \/>\nlibfaac.so.0 =&gt; \/usr\/local\/lib\/libfaac.so.0 (0x00573000)<br \/>\n\/lib\/ld-linux.so.2 (0x005c2000)<br \/>\nlibdl.so.2 =&gt; \/lib\/libdl.so.2 (0x001a1000)<br \/>\nlibraw1394.so.11 =&gt; \/usr\/local\/lib\/libraw1394.so.11 (0x005b5000)<br \/>\nlibfribidi.so.0 =&gt; \/usr\/local\/lib\/libfribidi.so.0 (0x007b5000)<br \/>\nlibfontconfig.so.1 =&gt; \/usr\/local\/lib\/libfontconfig.so.1 (0x007ea000)<br \/>\nlibogg.so.0 =&gt; \/usr\/local\/lib\/libogg.so.0 (0x00583000)<br \/>\nlibexpat.so.1 =&gt; \/lib\/libexpat.so.1 (0x00933000)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u7684\u7cfb\u7edf\u91cc\u6ca1\u6709\u8bbe\u7f6eLD_LIBRARY_PATH\u73af\u5883\u53d8\u91cf\uff0c\u4e0a\u4e00\u7bc7\u535a\u6587\u91cc\u7f16\u8bd1\u7684ffmpeg\u8fd0\u884c\u65f6\u4f9d\u8d56\u7684\u975e\u5e38\u591a\u7684\u52a8\u6001\u5e93\u3002\u73b0\u5728\u6211\u4eec\u628a\u5176\u4e2d\u7684\u4e00\u4e2a\u5e93libmp3lame.so.0\u4ece\/usr\/loca\/lib\u4e0b\u79fb\u52a8\u5230\/opt\u76ee\u5f55\u91cc\uff0c\u5e76\u6267\u884cldconfig\uff0c\u8ba9libmp3lame.so.0\u5f7b\u5e95\u4ece\/etc\/ld.so.cache\u91cc\u9762\u6d88\u5931\u3002\u5176\u5b9elibmp3lame.so.0\u53ea\u662flibmp3lame.so.0.0.0\u7684\u4e00\u4e2a\u7b26\u53f7\u94fe\u63a5\uff0c\u6211\u4eec\u771f\u6b63\u9700\u8981\u79fb\u52a8\u7684\u662f\u540e\u8005\uff0c\u5b8c\u4e86\u4e4b\u540e\u518d\u6267\u884cldd \/usr\/local\/bin\/ffmpeg\u65f6\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>[root@localhost ~]# ldd \/usr\/local\/bin\/ffmpeg<br \/>\nlinux-gate.so.1 =&gt; \u00a0(0x00249000)<br \/>\nlibavdevice.so.54 =&gt; \/usr\/local\/lib\/libavdevice.so.54 (0x00e12000)<br \/>\nlibavfilter.so.3 =&gt; \/usr\/local\/lib\/libavfilter.so.3 (0x00ccd000)<br \/>\nlibavformat.so.54 =&gt; \/usr\/local\/lib\/libavformat.so.54 (0x00891000)<br \/>\nlibavcodec.so.54 =&gt; \/usr\/local\/lib\/libavcodec.so.54 (0xb6877000)<br \/>\nlibpostproc.so.52 =&gt; \/usr\/local\/lib\/libpostproc.so.52 (0x001a6000)<br \/>\nlibswresample.so.0 =&gt; \/usr\/local\/lib\/libswresample.so.0 (0x00b8f000)<br \/>\nlibswscale.so.2 =&gt; \/usr\/local\/lib\/libswscale.so.2 (0x0024a000)<br \/>\nlibavutil.so.52 =&gt; \/usr\/local\/lib\/libavutil.so.52 (0x005d7000)<br \/>\nlibm.so.6 =&gt; \/lib\/libm.so.6 (0x007ad000)<br \/>\nlibpthread.so.0 =&gt; \/lib\/libpthread.so.0 (0x001f6000)<br \/>\nlibc.so.6 =&gt; \/lib\/libc.so.6 (0x0029f000)<br \/>\nlibasound.so.2 =&gt; \/lib\/libasound.so.2 (0x00604000)<br \/>\nlibdc1394.so.22 =&gt; \/usr\/local\/lib\/libdc1394.so.22 (0x00436000)<br \/>\nlibrt.so.1 =&gt; \/lib\/librt.so.1 (0x00a06000)<br \/>\nlibfreetype.so =&gt; \/usr\/local\/lib\/libfreetype.so (0x0052d000)<br \/>\nlibass.so.4 =&gt; \/usr\/local\/lib\/libass.so.4 (0x00211000)<br \/>\nlibssl.so.1.0.0 =&gt; \/usr\/local\/lib\/libssl.so.1.0.0 (0x00eed000)<br \/>\nlibcrypto.so.1.0.0 =&gt; \/usr\/local\/lib\/libcrypto.so.1.0.0 (0x00f46000)<br \/>\nlibrtmp.so.0 =&gt; \/usr\/local\/lib\/librtmp.so.0 (0x004b9000)<br \/>\nlibz.so.1 =&gt; \/lib\/libz.so.1 (0x0022a000)<br \/>\nlibx264.so.132 =&gt; \/usr\/local\/lib\/libx264.so.132 (0x0765d000)<br \/>\nlibvorbisenc.so.2 =&gt; \/usr\/local\/lib\/libvorbisenc.so.2 (0x00a0f000)<br \/>\nlibvorbis.so.0 =&gt; \/usr\/local\/lib\/libvorbis.so.0 (0x004ce000)<br \/>\nlibvo-aacenc.so.0 =&gt; \/usr\/local\/lib\/libvo-aacenc.so.0 (0x005a8000)<br \/>\nlibtwolame.so.0 =&gt; \/usr\/local\/lib\/libtwolame.so.0 (0x006f0000)<br \/>\nlibtheoraenc.so.1 =&gt; \/usr\/local\/lib\/libtheoraenc.so.1 (0x00710000)<br \/>\nlibtheoradec.so.1 =&gt; \/usr\/local\/lib\/libtheoradec.so.1 (0x00756000)<br \/>\nlibspeex.so.1 =&gt; \/usr\/local\/lib\/libspeex.so.1 (0x00770000)<br \/>\n<strong>libmp3lame.so.0 =&gt; not found \u00a0 \u00a0\/\/\u679c\u7136\u98d8\u7ea2\u4e86 \ud83d\ude42<\/strong><br \/>\nlibfaac.so.0 =&gt; \/usr\/local\/lib\/libfaac.so.0 (0x004a4000)<br \/>\n\/lib\/ld-linux.so.2 (0x0050d000)<br \/>\nlibdl.so.2 =&gt; \/lib\/libdl.so.2 (0x0023e000)<br \/>\nlibraw1394.so.11 =&gt; \/usr\/local\/lib\/libraw1394.so.11 (0x004f6000)<br \/>\nlibfribidi.so.0 =&gt; \/usr\/local\/lib\/libfribidi.so.0 (0x0078a000)<br \/>\nlibfontconfig.so.1 =&gt; \/usr\/local\/lib\/libfontconfig.so.1 (0x007d7000)<br \/>\nlibogg.so.0 =&gt; \/usr\/local\/lib\/libogg.so.0 (0x00243000)<br \/>\nlibexpat.so.1 =&gt; \/lib\/libexpat.so.1 (0x00806000)<\/p>\n<p>[root@localhost ~]# ffmpeg &#8211;help<br \/>\nffmpeg: error while loading shared libraries:\u00a0<strong>libmp3lame.so.0<\/strong>: cannot open shared object file: No such file or directory<strong>\u00a0\u00a0<\/strong>\/\/\u6b64\u65f6ffmpeg\u5f53\u7136\u8fd0\u884c\u4e0d\u8d77\u6765<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u4eec\u6765\u8bd5\u8bd5LD_LIBRARY_PATH\uff0c\u770b\u770b\u597d\u4f7f\u4e0d\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>[root@localhost\u00a0opt]# export LD_LIBRARY_PATH=\/opt:$LD_LIBRARY_PATH<br \/>\n[root@localhost\u00a0opt]#<br \/>\n[root@localhost\u00a0opt]# ldd \/usr\/local\/bin\/ffmpeg<br \/>\nlinux-gate.so.1 =&gt; \u00a0(0x00136000)<br \/>\nlibavdevice.so.54 =&gt; \/usr\/local\/lib\/libavdevice.so.54 (0x00552000)<br \/>\nlibavfilter.so.3 =&gt; \/usr\/local\/lib\/libavfilter.so.3 (0x00655000)<br \/>\nlibavformat.so.54 =&gt; \/usr\/local\/lib\/libavformat.so.54 (0x00243000)<br \/>\nlibavcodec.so.54 =&gt; \/usr\/local\/lib\/libavcodec.so.54 (0xb68a7000)<br \/>\nlibpostproc.so.52 =&gt; \/usr\/local\/lib\/libpostproc.so.52 (0x00137000)<br \/>\nlibswresample.so.0 =&gt; \/usr\/local\/lib\/libswresample.so.0 (0x00187000)<br \/>\nlibswscale.so.2 =&gt; \/usr\/local\/lib\/libswscale.so.2 (0x0047e000)<br \/>\nlibavutil.so.52 =&gt; \/usr\/local\/lib\/libavutil.so.52 (0x00a9d000)<br \/>\nlibm.so.6 =&gt; \/lib\/libm.so.6 (0x00af9000)<br \/>\nlibpthread.so.0 =&gt; \/lib\/libpthread.so.0 (0x00823000)<br \/>\nlibc.so.6 =&gt; \/lib\/libc.so.6 (0x0083e000)<br \/>\nlibasound.so.2 =&gt; \/lib\/libasound.so.2 (0x0055f000)<br \/>\nlibdc1394.so.22 =&gt; \/usr\/local\/lib\/libdc1394.so.22 (0x0019e000)<br \/>\nlibrt.so.1 =&gt; \/lib\/librt.so.1 (0x00b3c000)<br \/>\nlibfreetype.so =&gt; \/usr\/local\/lib\/libfreetype.so (0x0039f000)<br \/>\nlibass.so.4 =&gt; \/usr\/local\/lib\/libass.so.4 (0x00f67000)<br \/>\nlibssl.so.1.0.0 =&gt; \/usr\/local\/lib\/libssl.so.1.0.0 (0x00cb3000)<br \/>\nlibcrypto.so.1.0.0 =&gt; \/usr\/local\/lib\/libcrypto.so.1.0.0 (0x00d0c000)<br \/>\nlibrtmp.so.0 =&gt; \/usr\/local\/lib\/librtmp.so.0 (0x0020c000)<br \/>\nlibz.so.1 =&gt; \/lib\/libz.so.1 (0x00c77000)<br \/>\nlibx264.so.132 =&gt; \/usr\/local\/lib\/libx264.so.132 (0x00f80000)<br \/>\nlibvorbisenc.so.2 =&gt; \/usr\/local\/lib\/libvorbisenc.so.2 (0x07c66000)<br \/>\nlibvorbis.so.0 =&gt; \/usr\/local\/lib\/libvorbis.so.0 (0x0041a000)<br \/>\nlibvo-aacenc.so.0 =&gt; \/usr\/local\/lib\/libvo-aacenc.so.0 (0x0076c000)<br \/>\nlibtwolame.so.0 =&gt; \/usr\/local\/lib\/libtwolame.so.0 (0x004fe000)<br \/>\nlibtheoraenc.so.1 =&gt; \/usr\/local\/lib\/libtheoraenc.so.1 (0x00717000)<br \/>\nlibtheoradec.so.1 =&gt; \/usr\/local\/lib\/libtheoradec.so.1 (0x00f0c000)<br \/>\nlibspeex.so.1 =&gt; \/usr\/local\/lib\/libspeex.so.1 (0x00221000)<br \/>\n<strong>libmp3lame.so.0 =&gt; not found \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/\u7eb3\u5c3c\uff1f\uff1f\uff01\uff01\uff01<\/strong><br \/>\nlibfaac.so.0 =&gt; \/usr\/local\/lib\/libfaac.so.0 (0x00124000)<br \/>\n\/lib\/ld-linux.so.2 (0x00bad000)<br \/>\nlibdl.so.2 =&gt; \/lib\/libdl.so.2 (0x0023b000)<br \/>\nlibraw1394.so.11 =&gt; \/usr\/local\/lib\/libraw1394.so.11 (0x007b6000)<br \/>\nlibfribidi.so.0 =&gt; \/usr\/local\/lib\/libfribidi.so.0 (0x00442000)<br \/>\nlibfontconfig.so.1 =&gt; \/usr\/local\/lib\/libfontconfig.so.1 (0x0051e000)<br \/>\nlibogg.so.0 =&gt; \/usr\/local\/lib\/libogg.so.0 (0x009f7000)<br \/>\nlibexpat.so.1 =&gt; \/lib\/libexpat.so.1 (0x00b60000)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd8\u8bb0\u5f97\u4e0a\u9762\u63d0\u5230\u4e86\u8f6f\u94fe\u63a5\u4e48\uff0clibmp3lame.so.0\u5c31\u662flibmp3lame.so.0.0.0\u7684\u8f6f\u94fe\u63a5\uff0c\u8fd9\u662f\u52a8\u6001\u5e93\u7684\u547d\u540d\u89c4\u8303\u7684\u4e00\u79cd\u516c\u7ea6\uff0c\u6211\u4eec\u53ea\u8981\u5728\/opt\/\u76ee\u5f55\u4e0b\u5efa\u7acb\u4e00\u4e2a\u540d\u4e3alibmp3lame.so.0\u7684\u5230\/opt\/libmp3lame.so.0.0.0\u7684\u8f6f\u94fe\u63a5\u5c31OK\u4e86\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>[root@localhost opt]# ls<br \/>\nlibmp3lame.so.0.0.0<br \/>\n[root@localhost opt]# ln -s libmp3lame.so.0.0.0 libmp3lame.so.0<br \/>\n[root@localhost opt]# ll<br \/>\ntotal 316<br \/>\nlrwxrwxrwx. 1 root root \u00a0 \u00a0 19 Dec \u00a07 23:27\u00a0libmp3lame.so.0\u00a0-&gt;\u00a0libmp3lame.so.0.0.0<br \/>\n-rwxr-xr-x. 1 root root 321228 Dec \u00a07 23:25\u00a0libmp3lame.so.0.0.0<br \/>\n[root@localhost opt]# ldd \/usr\/local\/bin\/ffmpeg<br \/>\nlinux-gate.so.1 =&gt; \u00a0(0x00cc4000)<br \/>\nlibavdevice.so.54 =&gt; \/usr\/local\/lib\/libavdevice.so.54 (0x00577000)<br \/>\nlibavfilter.so.3 =&gt; \/usr\/local\/lib\/libavfilter.so.3 (0x00e3f000)<br \/>\nlibavformat.so.54 =&gt; \/usr\/local\/lib\/libavformat.so.54 (0x00202000)<br \/>\nlibavcodec.so.54 =&gt; \/usr\/local\/lib\/libavcodec.so.54 (0x00f01000)<br \/>\nlibpostproc.so.52 =&gt; \/usr\/local\/lib\/libpostproc.so.52 (0x00170000)<br \/>\nlibswresample.so.0 =&gt; \/usr\/local\/lib\/libswresample.so.0 (0x00750000)<br \/>\nlibswscale.so.2 =&gt; \/usr\/local\/lib\/libswscale.so.2 (0x0035e000)<br \/>\nlibavutil.so.52 =&gt; \/usr\/local\/lib\/libavutil.so.52 (0x005ba000)<br \/>\nlibm.so.6 =&gt; \/lib\/libm.so.6 (0x00452000)<br \/>\nlibpthread.so.0 =&gt; \/lib\/libpthread.so.0 (0x001c0000)<br \/>\nlibc.so.6 =&gt; \/lib\/libc.so.6 (0x008c2000)<br \/>\nlibasound.so.2 =&gt; \/lib\/libasound.so.2 (0x0047c000)<br \/>\nlibdc1394.so.22 =&gt; \/usr\/local\/lib\/libdc1394.so.22 (0x003d6000)<br \/>\nlibrt.so.1 =&gt; \/lib\/librt.so.1 (0x00db3000)<br \/>\nlibfreetype.so =&gt; \/usr\/local\/lib\/libfreetype.so (0x00a80000)<br \/>\nlibass.so.4 =&gt; \/usr\/local\/lib\/libass.so.4 (0x001db000)<br \/>\nlibssl.so.1.0.0 =&gt; \/usr\/local\/lib\/libssl.so.1.0.0 (0x005e7000)<br \/>\nlibcrypto.so.1.0.0 =&gt; \/usr\/local\/lib\/libcrypto.so.1.0.0 (0x00afb000)<br \/>\nlibrtmp.so.0 =&gt; \/usr\/local\/lib\/librtmp.so.0 (0x00584000)<br \/>\nlibz.so.1 =&gt; \/lib\/libz.so.1 (0x00599000)<br \/>\nlibx264.so.132 =&gt; \/usr\/local\/lib\/libx264.so.132 (0x02bc9000)<br \/>\nlibvorbisenc.so.2 =&gt; \/usr\/local\/lib\/libvorbisenc.so.2 (0x05ccd000)<br \/>\nlibvorbis.so.0 =&gt; \/usr\/local\/lib\/libvorbis.so.0 (0x00640000)<br \/>\nlibvo-aacenc.so.0 =&gt; \/usr\/local\/lib\/libvo-aacenc.so.0 (0x00834000)<br \/>\nlibtwolame.so.0 =&gt; \/usr\/local\/lib\/libtwolame.so.0 (0x00668000)<br \/>\nlibtheoraenc.so.1 =&gt; \/usr\/local\/lib\/libtheoraenc.so.1 (0x00688000)<br \/>\nlibtheoradec.so.1 =&gt; \/usr\/local\/lib\/libtheoradec.so.1 (0x006ce000)<br \/>\nlibspeex.so.1 =&gt; \/usr\/local\/lib\/libspeex.so.1 (0x00815000)<br \/>\n<strong>libmp3lame.so.0 =&gt; \/opt\/libmp3lame.so.0 (0x00767000) \u00a0 \/\/\u7ec8\u4e8e\u5706\u6ee1\u4e86:)<\/strong><br \/>\nlibfaac.so.0 =&gt; \/usr\/local\/lib\/libfaac.so.0 (0x006e8000)<br \/>\n\/lib\/ld-linux.so.2 (0x003b6000)<br \/>\nlibdl.so.2 =&gt; \/lib\/libdl.so.2 (0x001f4000)<br \/>\nlibraw1394.so.11 =&gt; \/usr\/local\/lib\/libraw1394.so.11 (0x00444000)<br \/>\nlibfribidi.so.0 =&gt; \/usr\/local\/lib\/libfribidi.so.0 (0x006f8000)<br \/>\nlibfontconfig.so.1 =&gt; \/usr\/local\/lib\/libfontconfig.so.1 (0x00710000)<br \/>\nlibogg.so.0 =&gt; \/usr\/local\/lib\/libogg.so.0 (0x001f9000)<br \/>\nlibexpat.so.1 =&gt; \/lib\/libexpat.so.1 (0x007e3000)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6240\u4ee5\u8bf4\uff0c\u9488\u5bf9\u52a8\u6001\u5e93\u8def\u5f84\u67e5\u627e\u7684\u79cd\u79cd\u95ee\u9898\uff0c\u65e0\u975e\u5c31\u8fd9\u4e48\u4e24\u5927\u7c7b\uff0c\u5173\u952e\u662f\u627e\u5bf9\u539f\u56e0\uff0c\u5bf9\u75c7\u4e0b\u836f\uff0c\u65b9\u80fd\u836f\u5230\u75c5\u9664\u3002<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0\u539f\u6587\u5730\u5740 2013-12-08 23:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[117],"class_list":["post-3245","post","type-post","status-publish","format-standard","hentry","tag-01-linux"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/3245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=3245"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/3245\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=3245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=3245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=3245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}