{"id":93194,"date":"2026-08-12T07:33:26","date_gmt":"2026-08-11T23:33:26","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/93194.html"},"modified":"2026-08-12T07:33:26","modified_gmt":"2026-08-11T23:33:26","slug":"%e3%80%90linux%e6%8c%87%e5%8d%97%e3%80%91%e5%8a%a8%e9%9d%99%e6%80%81%e5%ba%93%e7%b3%bb%e5%88%97%ef%bc%88%e4%ba%94%ef%bc%89%ef%bc%9a%e5%8a%a8%e6%80%81%e5%ba%93%e8%bf%90%e8%a1%8c%e6%8a%a5%e9%94%99","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/93194.html","title":{"rendered":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\n<ul>\n<li>\u4e00\u3001\u5148\u590d\u73b0\u95ee\u9898<\/li>\n<li>\u4e8c\u3001\u7f16\u8bd1\u671f\u627e\u5e93\u548c\u8fd0\u884c\u671f\u627e\u5e93\u4e0d\u662f\u4e00\u56de\u4e8b<\/li>\n<li>\n<ul>\n<li>1. \u7f16\u8bd1\u94fe\u63a5\u9636\u6bb5<\/li>\n<li>2. \u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001\u7528 ldd \u67e5\u770b\u52a8\u6001\u4f9d\u8d56<\/li>\n<li>\u56db\u3001\u52a8\u6001\u94fe\u63a5\u5668\u9ed8\u8ba4\u53bb\u54ea\u91cc\u627e\u5e93<\/li>\n<li>\u4e94\u3001\u89e3\u51b3\u65b9\u6848\u4e00&#xff1a;\u62f7\u8d1d\u5230\u7cfb\u7edf\u5e93\u8def\u5f84<\/li>\n<li>\u516d\u3001\u89e3\u51b3\u65b9\u6848\u4e8c&#xff1a;\u5728\u7cfb\u7edf\u8def\u5f84\u5efa\u7acb\u8f6f\u94fe\u63a5<\/li>\n<li>\u4e03\u3001\u89e3\u51b3\u65b9\u6848\u4e09&#xff1a;\u8bbe\u7f6e LD_LIBRARY_PATH<\/li>\n<li>\u516b\u3001\u89e3\u51b3\u65b9\u6848\u56db&#xff1a;\u914d\u7f6e ld.so.conf.d \u5e76\u6267\u884c ldconfig<\/li>\n<li>\u4e5d\u3001\u89e3\u51b3\u65b9\u6848\u4e94&#xff1a;\u7f16\u8bd1\u65f6\u5199\u5165 rpath<\/li>\n<li>\u5341\u3001\u4e94\u79cd\u65b9\u6848\u5bf9\u6bd4<\/li>\n<li>\u5341\u4e00\u3001\u4e3a\u4ec0\u4e48\u9759\u6001\u5e93\u6ca1\u6709\u8fd9\u4e2a\u95ee\u9898<\/li>\n<li>\u5341\u4e8c\u3001\u51e0\u4e2a\u5e38\u7528\u6392\u67e5\u547d\u4ee4<\/li>\n<li>\n<ul>\n<li>1. ldd<\/li>\n<li>2. file<\/li>\n<li>3. readelf -d<\/li>\n<li>4. ldconfig -p<\/li>\n<\/ul>\n<\/li>\n<li>\u5341\u4e09\u3001\u4e00\u6b21\u5b8c\u6574\u6392\u67e5\u6d41\u7a0b<\/li>\n<li>\u5341\u56db\u3001\u603b\u7ed3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u4e0a\u4e00\u7bc7\u6211\u4eec\u5df2\u7ecf\u80fd\u5236\u4f5c\u5e76\u94fe\u63a5\u52a8\u6001\u5e93\u4e86\u3002\u5f88\u591a\u540c\u5b66\u7b2c\u4e00\u6b21\u505a\u52a8\u6001\u5e93\u65f6&#xff0c;\u4f1a\u9047\u5230\u4e00\u4e2a\u975e\u5e38\u5178\u578b\u7684\u95ee\u9898&#xff1a;<\/p>\n<p>gcc main.c -I.\/include -L.\/lib <span class=\"token parameter variable\">-lmyc<\/span> <span class=\"token parameter variable\">-o<\/span> main<\/p>\n<p>\u7f16\u8bd1\u94fe\u63a5\u660e\u660e\u6210\u529f\u4e86&#xff0c;\u4f46\u4e00\u8fd0\u884c&#xff1a;<\/p>\n<p>.\/main<\/p>\n<p>\u5374\u62a5\u9519&#xff1a;<\/p>\n<p>error while loading shared libraries: libmyc.so: cannot open shared object file: No such file or directory<\/p>\n<p>\u6216\u8005\u7528 ldd \u67e5\u770b\u65f6\u770b\u5230&#xff1a;<\/p>\n<p>libmyc.so &#061;&gt; not found<\/p>\n<p>\u8fd9\u4e2a\u95ee\u9898\u975e\u5e38\u5173\u952e&#xff0c;\u56e0\u4e3a\u5b83\u8bf4\u660e\u52a8\u6001\u5e93\u6709\u4e24\u4e2a\u9636\u6bb5\u90fd\u8981\u201c\u627e\u5e93\u201d&#xff1a;\u7f16\u8bd1\u94fe\u63a5\u9636\u6bb5\u8981\u627e&#xff0c;\u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5\u8fd8\u8981\u518d\u627e\u3002\u672c\u6587\u5c31\u4e13\u95e8\u628a\u8fd9\u4ef6\u4e8b\u8bb2\u900f\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260811233323-6a7bb143696d7.png\" alt=\"image.png\" \/><\/p>\n<h3>\u4e00\u3001\u5148\u590d\u73b0\u95ee\u9898<\/h3>\n<p>\u5047\u8bbe\u6211\u4eec\u7684\u76ee\u5f55\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<p>shared_lib_demo\/<br \/>\n\u251c\u2500\u2500 include\/<br \/>\n\u2502   \u2514\u2500\u2500 my_math.h<br \/>\n\u251c\u2500\u2500 lib\/<br \/>\n\u2502   \u2514\u2500\u2500 libmyc.so<br \/>\n\u2514\u2500\u2500 main.c<\/p>\n<p>main.c \u8c03\u7528\u4e86 libmyc.so \u4e2d\u7684\u51fd\u6570\u3002<\/p>\n<p>\u7f16\u8bd1\u547d\u4ee4&#xff1a;<\/p>\n<p>gcc main.c -I.\/include -L.\/lib <span class=\"token parameter variable\">-lmyc<\/span> <span class=\"token parameter variable\">-o<\/span> main<\/p>\n<p>\u8fd9\u6761\u547d\u4ee4\u53ef\u80fd\u6210\u529f\u751f\u6210 main\u3002<\/p>\n<p>\u4f46\u662f\u6267\u884c&#xff1a;<\/p>\n<p>.\/main<\/p>\n<p>\u53ef\u80fd\u62a5\u9519&#xff1a;<\/p>\n<p>.\/main: error while loading shared libraries: libmyc.so: cannot open shared object file: No such file or directory<\/p>\n<p>\u8fd9\u65f6\u5019\u5f88\u591a\u4eba\u4f1a\u56f0\u60d1&#xff1a;<\/p>\n<p>\u7f16\u8bd1\u7684\u65f6\u5019\u4e0d\u662f\u5df2\u7ecf\u7528 -L.\/lib \u544a\u8bc9 gcc \u5e93\u5728\u54ea\u91cc\u4e86\u5417&#xff1f;<br \/>\n\u4e3a\u4ec0\u4e48\u8fd0\u884c\u7684\u65f6\u5019\u8fd8\u8bf4\u627e\u4e0d\u5230&#xff1f;<\/p>\n<p>\u7b54\u6848\u662f&#xff1a;<\/p>\n<p>-L \u53ea\u5f71\u54cd\u7f16\u8bd1\u94fe\u63a5\u9636\u6bb5&#xff0c;\u4e0d\u8d1f\u8d23\u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5\u3002<\/p>\n<h3>\u4e8c\u3001\u7f16\u8bd1\u671f\u627e\u5e93\u548c\u8fd0\u884c\u671f\u627e\u5e93\u4e0d\u662f\u4e00\u56de\u4e8b<\/h3>\n<p>\u52a8\u6001\u5e93\u6709\u4e24\u4e2a\u91cd\u8981\u9636\u6bb5\u3002<\/p>\n<h4>1. \u7f16\u8bd1\u94fe\u63a5\u9636\u6bb5<\/h4>\n<p>\u547d\u4ee4&#xff1a;<\/p>\n<p>gcc main.c -I.\/include -L.\/lib <span class=\"token parameter variable\">-lmyc<\/span> <span class=\"token parameter variable\">-o<\/span> main<\/p>\n<p>\u8fd9\u65f6\u53c2\u4e0e\u5de5\u4f5c\u7684\u4e3b\u8981\u662f\u7f16\u8bd1\u5668\u548c\u94fe\u63a5\u5668\u3002<\/p>\n<p>\u53c2\u6570\u542b\u4e49&#xff1a;<\/p>\n<p>-I.\/include  \u544a\u8bc9\u7f16\u8bd1\u5668\u53bb\u54ea\u91cc\u627e\u5934\u6587\u4ef6<br \/>\n-L.\/lib      \u544a\u8bc9\u94fe\u63a5\u5668\u53bb\u54ea\u91cc\u627e\u5e93\u6587\u4ef6<br \/>\n-lmyc        \u544a\u8bc9\u94fe\u63a5\u5668\u94fe\u63a5 libmyc.so \u6216 libmyc.a<\/p>\n<p>\u53ea\u8981\u94fe\u63a5\u5668\u5728 .\/lib \u4e0b\u627e\u5230\u4e86 libmyc.so&#xff0c;\u5b83\u5c31\u53ef\u4ee5\u751f\u6210\u53ef\u6267\u884c\u7a0b\u5e8f\u3002<\/p>\n<h4>2. \u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5<\/h4>\n<p>\u5f53\u4f60\u6267\u884c&#xff1a;<\/p>\n<p>.\/main<\/p>\n<p>\u6b64\u65f6\u4e0d\u518d\u662f gcc \u5728\u5de5\u4f5c&#xff0c;\u800c\u662f\u64cd\u4f5c\u7cfb\u7edf\u52a0\u8f7d\u7a0b\u5e8f&#xff0c;\u5e76\u7531\u52a8\u6001\u94fe\u63a5\u5668\u8d1f\u8d23\u52a0\u8f7d\u4f9d\u8d56\u7684 .so\u3002<\/p>\n<p>Linux \u4e0b\u5e38\u89c1\u52a8\u6001\u94fe\u63a5\u5668\u662f&#xff1a;<\/p>\n<p>\/lib64\/ld-linux-x86-64.so.2<\/p>\n<p>\u6216\u8005 Ubuntu\/Debian \u4e0a\u7c7b\u4f3c&#xff1a;<\/p>\n<p>\/lib\/x86_64-linux-gnu\/ld-linux-x86-64.so.2<\/p>\n<p>\u52a8\u6001\u94fe\u63a5\u5668\u5e76\u4e0d\u4f1a\u81ea\u52a8\u8bb0\u4f4f\u4f60\u7f16\u8bd1\u65f6\u5199\u8fc7\u7684 -L.\/lib\u3002\u6240\u4ee5\u5982\u679c\u5b83\u7684\u641c\u7d22\u8def\u5f84\u91cc\u6ca1\u6709 .\/lib&#xff0c;\u8fd0\u884c\u65f6\u5c31\u627e\u4e0d\u5230 libmyc.so\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u95ee\u9898\u672c\u8d28\u3002<\/p>\n<h3>\u4e09\u3001\u7528 ldd \u67e5\u770b\u52a8\u6001\u4f9d\u8d56<\/h3>\n<p>ldd \u53ef\u4ee5\u67e5\u770b\u4e00\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f\u4f9d\u8d56\u54ea\u4e9b\u52a8\u6001\u5e93&#xff1a;<\/p>\n<p>ldd .\/main<\/p>\n<p>\u5982\u679c\u5e93\u627e\u4e0d\u5230&#xff0c;\u4f1a\u770b\u5230&#xff1a;<\/p>\n<p>linux-vdso.so.1<br \/>\nlibmyc.so &#061;&gt; not found<br \/>\nlibc.so.6 &#061;&gt; \/lib64\/libc.so.6<br \/>\n\/lib64\/ld-linux-x86-64.so.2<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>libmyc.so &#061;&gt; not found<\/p>\n<p>\u8bf4\u660e\u53ef\u6267\u884c\u7a0b\u5e8f\u786e\u5b9e\u8bb0\u5f55\u4e86\u5bf9 libmyc.so \u7684\u4f9d\u8d56&#xff0c;\u4f46\u52a8\u6001\u94fe\u63a5\u5668\u5728\u8fd0\u884c\u641c\u7d22\u8def\u5f84\u4e2d\u6ca1\u6709\u627e\u5230\u5b83\u3002<\/p>\n<p>\u5982\u679c\u5e93\u80fd\u627e\u5230&#xff0c;\u5219\u53ef\u80fd\u663e\u793a&#xff1a;<\/p>\n<p>libmyc.so &#061;&gt; .\/lib\/libmyc.so<\/p>\n<p>\u6216&#xff1a;<\/p>\n<p>libmyc.so &#061;&gt; \/usr\/local\/lib\/libmyc.so<\/p>\n<p>\u6240\u4ee5\u6392\u67e5\u52a8\u6001\u5e93\u8fd0\u884c\u95ee\u9898\u65f6&#xff0c;\u7b2c\u4e00\u6b65\u901a\u5e38\u5c31\u662f&#xff1a;<\/p>\n<p>ldd .\/main<\/p>\n<h3>\u56db\u3001\u52a8\u6001\u94fe\u63a5\u5668\u9ed8\u8ba4\u53bb\u54ea\u91cc\u627e\u5e93<\/h3>\n<p>\u52a8\u6001\u94fe\u63a5\u5668\u8fd0\u884c\u65f6\u67e5\u627e .so&#xff0c;\u5e38\u89c1\u6765\u6e90\u5305\u62ec&#xff1a;<\/p>\n<li>\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u8bb0\u5f55\u7684 rpath\/runpath\u3002<\/li>\n<li>\u73af\u5883\u53d8\u91cf LD_LIBRARY_PATH \u6307\u5b9a\u7684\u8def\u5f84\u3002<\/li>\n<li>\/etc\/ld.so.cache \u7f13\u5b58\u4e2d\u7684\u8def\u5f84\u3002<\/li>\n<li>\u7cfb\u7edf\u9ed8\u8ba4\u5e93\u76ee\u5f55&#xff0c;\u4f8b\u5982 \/lib\u3001\/usr\/lib\u3001\/lib64\u3001\/usr\/lib64\u3002<\/li>\n<li>\/etc\/ld.so.conf \u548c \/etc\/ld.so.conf.d\/ \u914d\u7f6e\u540e\u7ecf ldconfig \u751f\u6210\u7684\u7f13\u5b58\u8def\u5f84\u3002<\/li>\n<p>\u4e0d\u540c\u7cfb\u7edf\u3001\u4e0d\u540c\u94fe\u63a5\u9009\u9879\u4e0b\u7684\u7cbe\u786e\u987a\u5e8f\u4f1a\u6d89\u53ca\u4e00\u4e9b\u7ec6\u8282\u3002\u521d\u5b66\u9636\u6bb5\u5148\u6293\u4f4f\u6838\u5fc3&#xff1a;<\/p>\n<p>\u8fd0\u884c\u65f6\u627e\u5e93\u7531\u52a8\u6001\u94fe\u63a5\u5668\u8d1f\u8d23&#xff0c;\u548c gcc \u7f16\u8bd1\u65f6\u7684 -L \u4e0d\u662f\u4e00\u5957\u673a\u5236\u3002<\/p>\n<h3>\u4e94\u3001\u89e3\u51b3\u65b9\u6848\u4e00&#xff1a;\u62f7\u8d1d\u5230\u7cfb\u7edf\u5e93\u8def\u5f84<\/h3>\n<p>\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u662f\u628a .so \u62f7\u8d1d\u5230\u7cfb\u7edf\u9ed8\u8ba4\u5e93\u8def\u5f84&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">cp<\/span> libmyc.so \/usr\/local\/lib\/<br \/>\n<span class=\"token function\">sudo<\/span> ldconfig<\/p>\n<p>\u6216\u8005\u67d0\u4e9b\u7cfb\u7edf\u4e2d\u4f7f\u7528&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">cp<\/span> libmyc.so \/lib64\/<br \/>\n<span class=\"token function\">sudo<\/span> ldconfig<\/p>\n<p>\u8fd9\u6837\u52a8\u6001\u94fe\u63a5\u5668\u5c31\u80fd\u4ece\u7cfb\u7edf\u8def\u5f84\u627e\u5230\u5b83\u3002<\/p>\n<p>\u4f46\u8fd9\u4e2a\u65b9\u6848\u4e0d\u9002\u5408\u5b66\u4e60\u5b9e\u9a8c\u4e2d\u968f\u4fbf\u4e71\u7528&#xff0c;\u56e0\u4e3a&#xff1a;<\/p>\n<li>\u9700\u8981 root \u6743\u9650\u3002<\/li>\n<li>\u5bb9\u6613\u6c61\u67d3\u7cfb\u7edf\u5e93\u76ee\u5f55\u3002<\/li>\n<li>\u591a\u7248\u672c\u5e93\u53ef\u80fd\u51b2\u7a81\u3002<\/li>\n<li>\u5220\u9664\u4e0d\u5e72\u51c0\u4f1a\u5f71\u54cd\u540e\u7eed\u5b9e\u9a8c\u3002<\/li>\n<p>\u6240\u4ee5\u5b66\u4e60\u9636\u6bb5\u66f4\u63a8\u8350\u4f7f\u7528 LD_LIBRARY_PATH \u6216 rpath\u3002<\/p>\n<h3>\u516d\u3001\u89e3\u51b3\u65b9\u6848\u4e8c&#xff1a;\u5728\u7cfb\u7edf\u8def\u5f84\u5efa\u7acb\u8f6f\u94fe\u63a5<\/h3>\n<p>\u5982\u679c\u771f\u5b9e\u5e93\u5728\u67d0\u4e2a\u81ea\u5b9a\u4e49\u76ee\u5f55&#xff0c;\u53ef\u4ee5\u5728\u7cfb\u7edf\u5e93\u8def\u5f84\u4e2d\u5efa\u7acb\u8f6f\u94fe\u63a5&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">ln<\/span> <span class=\"token parameter variable\">-s<\/span> \/home\/user\/mylib\/libmyc.so \/usr\/local\/lib\/libmyc.so<br \/>\n<span class=\"token function\">sudo<\/span> ldconfig<\/p>\n<p>\u8fd9\u6837\u7cfb\u7edf\u8def\u5f84\u4e0b\u770b\u8d77\u6765\u6709 libmyc.so&#xff0c;\u5b9e\u9645\u6587\u4ef6\u4ecd\u5728\u539f\u4f4d\u7f6e\u3002<\/p>\n<p>\u8f6f\u94fe\u63a5\u65b9\u6848\u6bd4\u76f4\u63a5\u62f7\u8d1d\u66f4\u65b9\u4fbf\u7ef4\u62a4&#xff0c;\u4f46\u4f9d\u7136\u9700\u8981 root \u6743\u9650&#xff0c;\u4e5f\u9700\u8981\u6ce8\u610f\u4e0d\u8981\u6c61\u67d3\u7cfb\u7edf\u76ee\u5f55\u3002<\/p>\n<h3>\u4e03\u3001\u89e3\u51b3\u65b9\u6848\u4e09&#xff1a;\u8bbe\u7f6e LD_LIBRARY_PATH<\/h3>\n<p>\u5b66\u4e60\u548c\u4e34\u65f6\u6d4b\u8bd5\u6700\u5e38\u7528\u7684\u662f&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">LD_LIBRARY_PATH<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token environment constant\">$PWD<\/span>\/lib:<span class=\"token variable\">$LD_LIBRARY_PATH<\/span><br \/>\n.\/main<\/p>\n<p>\u5982\u679c\u5e93\u5c31\u5728\u5f53\u524d\u76ee\u5f55&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">LD_LIBRARY_PATH<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token environment constant\">$PWD<\/span><span class=\"token builtin class-name\">:<\/span><span class=\"token variable\">$LD_LIBRARY_PATH<\/span><br \/>\n.\/main<\/p>\n<p>LD_LIBRARY_PATH \u662f\u73af\u5883\u53d8\u91cf&#xff0c;\u7528\u6765\u544a\u8bc9\u52a8\u6001\u94fe\u63a5\u5668\u989d\u5916\u641c\u7d22\u54ea\u4e9b\u8def\u5f84\u3002<\/p>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<li>\u4e0d\u9700\u8981\u4fee\u6539\u7cfb\u7edf\u76ee\u5f55\u3002<\/li>\n<li>\u9002\u5408\u4e34\u65f6\u6d4b\u8bd5\u3002<\/li>\n<li>\u6539\u52a8\u8303\u56f4\u53ea\u5f71\u54cd\u5f53\u524d shell \u53ca\u5176\u5b50\u8fdb\u7a0b\u3002<\/li>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<li>\u5173\u95ed\u7ec8\u7aef\u540e\u53ef\u80fd\u5931\u6548\u3002<\/li>\n<li>\u4e0d\u9002\u5408\u4f5c\u4e3a\u4e25\u8083\u53d1\u5e03\u65b9\u6848\u3002<\/li>\n<li>\u8bbe\u7f6e\u4e0d\u5f53\u53ef\u80fd\u5bfc\u81f4\u52a0\u8f7d\u5230\u9519\u8bef\u7248\u672c\u7684\u5e93\u3002<\/li>\n<p>\u6bd4\u5982\u4f60\u53ef\u4ee5\u8fd9\u6837\u9a8c\u8bc1&#xff1a;<\/p>\n<p>ldd .\/main<br \/>\n<span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">LD_LIBRARY_PATH<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token environment constant\">$PWD<\/span>\/lib:<span class=\"token variable\">$LD_LIBRARY_PATH<\/span><br \/>\nldd .\/main<\/p>\n<p>\u524d\u540e\u5bf9\u6bd4 ldd \u8f93\u51fa&#xff0c;\u4f1a\u770b\u5230 libmyc.so \u4ece not found \u53d8\u6210\u5177\u4f53\u8def\u5f84\u3002<\/p>\n<h3>\u516b\u3001\u89e3\u51b3\u65b9\u6848\u56db&#xff1a;\u914d\u7f6e ld.so.conf.d \u5e76\u6267\u884c ldconfig<\/h3>\n<p>\u66f4\u7cfb\u7edf\u5316\u7684\u65b9\u5f0f\u662f\u628a\u5e93\u8def\u5f84\u52a0\u5165\u52a8\u6001\u94fe\u63a5\u5668\u914d\u7f6e\u3002<\/p>\n<p>\u4f8b\u5982\u4f60\u7684\u5e93\u5728&#xff1a;<\/p>\n<p>\/home\/user\/mylib\/lib<\/p>\n<p>\u53ef\u4ee5\u521b\u5efa\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">sh<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token string\">&#039;echo \/home\/user\/mylib\/lib &gt; \/etc\/ld.so.conf.d\/myc.conf&#039;<\/span><\/p>\n<p>\u7136\u540e\u6267\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> ldconfig<\/p>\n<p>ldconfig \u4f1a\u66f4\u65b0 \/etc\/ld.so.cache&#xff0c;\u52a8\u6001\u94fe\u63a5\u5668\u540e\u7eed\u53ef\u4ee5\u4ece\u7f13\u5b58\u4e2d\u627e\u5230\u8fd9\u4e9b\u5e93\u3002<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u9002\u5408\u7cfb\u7edf\u7ea7\u5b89\u88c5\u5e93\u3002<\/p>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<li>\u914d\u7f6e\u6301\u4e45\u6709\u6548\u3002<\/li>\n<li>\u4e0d\u9700\u8981\u6bcf\u6b21\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<li>\u7b26\u5408 Linux \u7cfb\u7edf\u7ba1\u7406\u4e60\u60ef\u3002<\/li>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<li>\u9700\u8981 root \u6743\u9650\u3002<\/li>\n<li>\u4e0d\u9002\u5408\u968f\u610f\u6d4b\u8bd5\u5927\u91cf\u4e34\u65f6\u5e93\u3002<\/li>\n<li>\u914d\u7f6e\u9519\u8bef\u4f1a\u5f71\u54cd\u7cfb\u7edf\u8303\u56f4\u3002<\/li>\n<h3>\u4e5d\u3001\u89e3\u51b3\u65b9\u6848\u4e94&#xff1a;\u7f16\u8bd1\u65f6\u5199\u5165 rpath<\/h3>\n<p>\u8fd8\u6709\u4e00\u79cd\u65b9\u5f0f&#xff1a;\u5728\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u65f6&#xff0c;\u628a\u52a8\u6001\u5e93\u641c\u7d22\u8def\u5f84\u5199\u8fdb\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>gcc main.c -I.\/include -L.\/lib <span class=\"token parameter variable\">-lmyc<\/span> -Wl,-rpath<span class=\"token operator\">&#061;<\/span>.\/lib <span class=\"token parameter variable\">-o<\/span> main<\/p>\n<p>\u8fd9\u91cc\u7684&#xff1a;<\/p>\n<p>-Wl,-rpath&#061;.\/lib<\/p>\n<p>\u610f\u601d\u662f\u628a -rpath&#061;.\/lib \u4f20\u7ed9\u94fe\u63a5\u5668\u3002<\/p>\n<p>\u8fd9\u6837\u8fd0\u884c\u65f6&#xff0c;\u52a8\u6001\u94fe\u63a5\u5668\u4f1a\u6839\u636e\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u8bb0\u5f55\u7684\u8def\u5f84\u53bb\u627e libmyc.so\u3002<\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528 readelf -d \u67e5\u770b\u52a8\u6001\u6bb5\u4fe1\u606f&#xff1a;<\/p>\n<p>readelf <span class=\"token parameter variable\">-d<\/span> .\/main <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-E<\/span> <span class=\"token string\">&#034;RPATH|RUNPATH|NEEDED&#034;<\/span><\/p>\n<p>\u53ef\u80fd\u770b\u5230&#xff1a;<\/p>\n<p>NEEDED               Shared library: [libmyc.so]<br \/>\nRUNPATH              Library runpath: [.\/lib]<\/p>\n<p>\u8fd9\u79cd\u65b9\u6848\u9002\u5408\u628a\u5e93\u548c\u7a0b\u5e8f\u653e\u5728\u76f8\u5bf9\u56fa\u5b9a\u76ee\u5f55\u7ed3\u6784\u4e2d\u7684\u9879\u76ee\u3002<\/p>\n<h3>\u5341\u3001\u4e94\u79cd\u65b9\u6848\u5bf9\u6bd4<\/h3>\n<table>\n<tr>\u65b9\u6848\u662f\u5426\u6301\u4e45\u662f\u5426\u9700\u8981 root\u9002\u7528\u573a\u666f\u98ce\u9669<\/tr>\n<tbody>\n<tr>\n<td>\u62f7\u8d1d\u5230\u7cfb\u7edf\u5e93\u8def\u5f84<\/td>\n<td>\u6301\u4e45<\/td>\n<td>\u9700\u8981<\/td>\n<td>\u7cfb\u7edf\u5b89\u88c5<\/td>\n<td>\u6c61\u67d3\u7cfb\u7edf\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td>\u7cfb\u7edf\u8def\u5f84\u5efa\u8f6f\u94fe\u63a5<\/td>\n<td>\u6301\u4e45<\/td>\n<td>\u9700\u8981<\/td>\n<td>\u7cfb\u7edf\u5b89\u88c5\/\u7248\u672c\u7ba1\u7406<\/td>\n<td>\u94fe\u63a5\u9519\u8bef\u4f1a\u5f71\u54cd\u7cfb\u7edf<\/td>\n<\/tr>\n<tr>\n<td>LD_LIBRARY_PATH<\/td>\n<td>\u4e34\u65f6<\/td>\n<td>\u4e0d\u9700\u8981<\/td>\n<td>\u5b66\u4e60\u3001\u6d4b\u8bd5\u3001\u4e34\u65f6\u8fd0\u884c<\/td>\n<td>\u5bb9\u6613\u52a0\u8f7d\u9519\u5e93<\/td>\n<\/tr>\n<tr>\n<td>ld.so.conf.d &#043; ldconfig<\/td>\n<td>\u6301\u4e45<\/td>\n<td>\u9700\u8981<\/td>\n<td>\u6b63\u89c4\u7cfb\u7edf\u7ea7\u5b89\u88c5<\/td>\n<td>\u914d\u7f6e\u5f71\u54cd\u5168\u5c40<\/td>\n<\/tr>\n<tr>\n<td>-Wl,-rpath<\/td>\n<td>\u968f\u7a0b\u5e8f<\/td>\n<td>\u4e0d\u9700\u8981 root<\/td>\n<td>\u5de5\u7a0b\u53d1\u5e03\u3001\u76f8\u5bf9\u8def\u5f84\u56fa\u5b9a<\/td>\n<td>\u8def\u5f84\u5199\u6b7b\u9700\u8c28\u614e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b66\u4e60\u9636\u6bb5\u5efa\u8bae&#xff1a;<\/p>\n<p>\u4f18\u5148 LD_LIBRARY_PATH \u6216 rpath&#xff1b;<br \/>\n\u4e0d\u8981\u968f\u4fbf\u628a\u5b9e\u9a8c\u5e93\u4e22\u8fdb\u7cfb\u7edf\u76ee\u5f55\u3002<\/p>\n<h3>\u5341\u4e00\u3001\u4e3a\u4ec0\u4e48\u9759\u6001\u5e93\u6ca1\u6709\u8fd9\u4e2a\u95ee\u9898<\/h3>\n<p>\u9759\u6001\u5e93 .a \u5728\u94fe\u63a5\u9636\u6bb5\u5df2\u7ecf\u628a\u76f8\u5173\u4ee3\u7801\u5408\u5e76\u8fdb\u53ef\u6267\u884c\u7a0b\u5e8f\u3002<\/p>\n<p>\u6240\u4ee5\u94fe\u63a5\u5b8c\u6210\u540e&#xff1a;<\/p>\n<p><span class=\"token function\">rm<\/span> libmyc.a<br \/>\n.\/main<\/p>\n<p>\u7a0b\u5e8f\u4ecd\u7136\u80fd\u8fd0\u884c\u3002<\/p>\n<p>\u52a8\u6001\u5e93\u4e0d\u540c\u3002\u53ef\u6267\u884c\u7a0b\u5e8f\u91cc\u6ca1\u6709\u5b8c\u6574\u5e93\u4ee3\u7801&#xff0c;\u53ea\u8bb0\u5f55\u4e86\u5bf9 libmyc.so \u7684\u4f9d\u8d56\u3002\u8fd0\u884c\u65f6\u5fc5\u987b\u80fd\u627e\u5230 .so\u3002<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u9759\u6001\u5e93\u95ee\u9898\u4e3b\u8981\u53d1\u751f\u5728\u7f16\u8bd1\u94fe\u63a5\u9636\u6bb5&#xff1b;<br \/>\n\u52a8\u6001\u5e93\u95ee\u9898\u65e2\u53ef\u80fd\u53d1\u751f\u5728\u7f16\u8bd1\u94fe\u63a5\u9636\u6bb5&#xff0c;\u4e5f\u53ef\u80fd\u53d1\u751f\u5728\u8fd0\u884c\u52a0\u8f7d\u9636\u6bb5\u3002<\/p>\n<h3>\u5341\u4e8c\u3001\u51e0\u4e2a\u5e38\u7528\u6392\u67e5\u547d\u4ee4<\/h3>\n<h4>1. ldd<\/h4>\n<p>\u67e5\u770b\u52a8\u6001\u4f9d\u8d56&#xff1a;<\/p>\n<p>ldd .\/main<\/p>\n<p>\u91cd\u70b9\u770b\u6709\u6ca1\u6709&#xff1a;<\/p>\n<p>not found<\/p>\n<h4>2. file<\/h4>\n<p>\u67e5\u770b\u6587\u4ef6\u7c7b\u578b&#xff1a;<\/p>\n<p><span class=\"token function\">file<\/span> .\/main<br \/>\n<span class=\"token function\">file<\/span> .\/lib\/libmyc.so<\/p>\n<p>\u53ef\u4ee5\u5224\u65ad\u662f\u4e0d\u662f ELF\u3001\u662f\u4e0d\u662f shared object\u3002<\/p>\n<h4>3. readelf -d<\/h4>\n<p>\u67e5\u770b\u52a8\u6001\u6bb5&#xff1a;<\/p>\n<p>readelf <span class=\"token parameter variable\">-d<\/span> .\/main<\/p>\n<p>\u91cd\u70b9\u770b&#xff1a;<\/p>\n<p>NEEDED<br \/>\nRPATH<br \/>\nRUNPATH<\/p>\n<h4>4. ldconfig -p<\/h4>\n<p>\u67e5\u770b\u7f13\u5b58\u4e2d\u6709\u54ea\u4e9b\u5e93&#xff1a;<\/p>\n<p>ldconfig <span class=\"token parameter variable\">-p<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> myc<\/p>\n<p>\u5982\u679c\u4f60\u5df2\u7ecf\u914d\u7f6e\u4e86 ld.so.conf.d \u5e76\u6267\u884c\u4e86 ldconfig&#xff0c;\u4f46\u8fd9\u91cc\u67e5\u4e0d\u5230\u5e93&#xff0c;\u5c31\u8bf4\u660e\u914d\u7f6e\u6ca1\u6709\u751f\u6548\u3002<\/p>\n<h3>\u5341\u4e09\u3001\u4e00\u6b21\u5b8c\u6574\u6392\u67e5\u6d41\u7a0b<\/h3>\n<p>\u9047\u5230\u52a8\u6001\u5e93\u8fd0\u884c\u5931\u8d25\u65f6&#xff0c;\u53ef\u4ee5\u6309\u8fd9\u4e2a\u987a\u5e8f\u6392\u67e5&#xff1a;<\/p>\n<p>1. ldd .\/main&#xff0c;\u770b\u662f\u4e0d\u662f libxxx.so &#061;&gt; not found<br \/>\n2. \u786e\u8ba4 libxxx.so \u662f\u5426\u771f\u5b9e\u5b58\u5728<br \/>\n3. \u786e\u8ba4\u7f16\u8bd1\u65f6 -L \u6307\u5411\u7684\u76ee\u5f55\u662f\u5426\u6b63\u786e<br \/>\n4. \u786e\u8ba4\u8fd0\u884c\u65f6\u52a8\u6001\u94fe\u63a5\u5668\u80fd\u5426\u627e\u5230\u8be5\u76ee\u5f55<br \/>\n5. \u4e34\u65f6\u8bbe\u7f6e LD_LIBRARY_PATH \u9a8c\u8bc1\u5e93\u672c\u8eab\u662f\u5426\u53ef\u7528<br \/>\n6. \u518d\u51b3\u5b9a\u4f7f\u7528 rpath\u3001ldconfig \u8fd8\u662f\u7cfb\u7edf\u5b89\u88c5\u65b9\u6848<\/p>\n<p>\u4e0d\u8981\u4e00\u4e0a\u6765\u5c31\u590d\u5236\u5e93\u5230 \/lib64\u3002\u5148\u5b9a\u4f4d\u95ee\u9898\u53d1\u751f\u5728\u54ea\u4e2a\u9636\u6bb5\u3002<\/p>\n<h3>\u5341\u56db\u3001\u603b\u7ed3<\/h3>\n<p>\u52a8\u6001\u5e93\u6700\u5bb9\u6613\u8ba9\u4eba\u56f0\u60d1\u7684\u70b9\u662f&#xff1a;<\/p>\n<p>\u7f16\u8bd1\u671f\u627e\u5e93\u548c\u8fd0\u884c\u671f\u627e\u5e93\u4e0d\u662f\u4e00\u56de\u4e8b\u3002<\/p>\n<p>-L \u53ea\u544a\u8bc9\u94fe\u63a5\u5668\u7f16\u8bd1\u65f6\u53bb\u54ea\u627e\u5e93&#xff1b;\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7531\u52a8\u6001\u94fe\u63a5\u5668\u8d1f\u8d23\u52a0\u8f7d .so&#xff0c;\u5b83\u6709\u81ea\u5df1\u7684\u641c\u7d22\u8def\u5f84\u89c4\u5219\u3002<\/p>\n<p>\u5e38\u89c1\u89e3\u51b3\u65b9\u5f0f\u5305\u62ec&#xff1a;<\/p>\n<p>LD_LIBRARY_PATH<br \/>\nldconfig<br \/>\n-Wl,-rpath<br \/>\n\u7cfb\u7edf\u5e93\u8def\u5f84<br \/>\n\u8f6f\u94fe\u63a5<\/p>\n<p>\u4e0b\u4e00\u7bc7\u5f00\u59cb&#xff0c;\u6211\u4eec\u8fdb\u5165\u66f4\u5e95\u5c42\u7684\u4e16\u754c&#xff1a;.o\u3001.so\u3001\u53ef\u6267\u884c\u6587\u4ef6\u4e3a\u4ec0\u4e48\u90fd\u5c5e\u4e8e ELF&#xff1f;\u94fe\u63a5\u5668\u5230\u5e95\u5728\u8fd9\u4e9b\u6587\u4ef6\u91cc\u5904\u7406\u4ec0\u4e48&#xff1f;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u76ee\u5f55\u4e00\u3001\u5148\u590d\u73b0\u95ee\u9898\u4e8c\u3001\u7f16\u8bd1\u671f\u627e\u5e93\u548c\u8fd0\u884c\u671f\u627e\u5e93\u4e0d\u662f\u4e00\u56de\u4e8b1. \u7f16\u8bd1\u94fe\u63a5\u9636\u6bb52. \u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5\u4e09\u3001\u7528 ldd \u67e5\u770b\u52a8\u6001\u4f9d\u8d56\u56db\u3001\u52a8\u6001\u94fe\u63a5\u5668\u9ed8\u8ba4\u53bb\u54ea\u91cc\u627e\u5e93\u4e94\u3001\u89e3\u51b3\u65b9\u6848\u4e00&#xff1a;\u62f7\u8d1d\u5230\u7cfb\u7edf\u5e93\u8def\u5f84\u516d\u3001\u89e3\u51b3\u65b9\u6848\u4e8c&#xff1a;\u5728\u7cfb\u7edf\u8def\u5f84\u5efa\u7acb\u8f6f\u94fe\u63a5\u4e03\u3001\u89e3\u51b3\u65b9\u6848\u4e09&#xff1a;\u8bbe\u7f6e LD_LIBRARY_PATH\u516b\u3001\u89e3\u51b3\u65b9\u6848\u56db&#xff1a;\u914d\u7f6e ld.so.conf.d \u5e76\u6267\u884c ldconfig\u4e5d\u3001\u89e3\u51b3\u65b9\u6848\u4e94&#xff1a;\u7f16\u8bd1\u65f6\u5199\u5165 rpath\u5341\u3001\u4e94\u79cd\u65b9\u6848\u5bf9\u6bd4\u5341\u4e00\u3001\u4e3a\u4ec0\u4e48\u9759<\/p>\n","protected":false},"author":2,"featured_media":93193,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-93194","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/93194.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u76ee\u5f55\u4e00\u3001\u5148\u590d\u73b0\u95ee\u9898\u4e8c\u3001\u7f16\u8bd1\u671f\u627e\u5e93\u548c\u8fd0\u884c\u671f\u627e\u5e93\u4e0d\u662f\u4e00\u56de\u4e8b1. \u7f16\u8bd1\u94fe\u63a5\u9636\u6bb52. \u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5\u4e09\u3001\u7528 ldd \u67e5\u770b\u52a8\u6001\u4f9d\u8d56\u56db\u3001\u52a8\u6001\u94fe\u63a5\u5668\u9ed8\u8ba4\u53bb\u54ea\u91cc\u627e\u5e93\u4e94\u3001\u89e3\u51b3\u65b9\u6848\u4e00&#xff1a;\u62f7\u8d1d\u5230\u7cfb\u7edf\u5e93\u8def\u5f84\u516d\u3001\u89e3\u51b3\u65b9\u6848\u4e8c&#xff1a;\u5728\u7cfb\u7edf\u8def\u5f84\u5efa\u7acb\u8f6f\u94fe\u63a5\u4e03\u3001\u89e3\u51b3\u65b9\u6848\u4e09&#xff1a;\u8bbe\u7f6e LD_LIBRARY_PATH\u516b\u3001\u89e3\u51b3\u65b9\u6848\u56db&#xff1a;\u914d\u7f6e ld.so.conf.d \u5e76\u6267\u884c ldconfig\u4e5d\u3001\u89e3\u51b3\u65b9\u6848\u4e94&#xff1a;\u7f16\u8bd1\u65f6\u5199\u5165 rpath\u5341\u3001\u4e94\u79cd\u65b9\u6848\u5bf9\u6bd4\u5341\u4e00\u3001\u4e3a\u4ec0\u4e48\u9759\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/93194.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-11T23:33:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260811233323-6a7bb143696d7.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/93194.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/93194.html\",\"name\":\"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-11T23:33:26+00:00\",\"dateModified\":\"2026-08-11T23:33:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/93194.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/93194.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/93194.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/93194.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u76ee\u5f55\u4e00\u3001\u5148\u590d\u73b0\u95ee\u9898\u4e8c\u3001\u7f16\u8bd1\u671f\u627e\u5e93\u548c\u8fd0\u884c\u671f\u627e\u5e93\u4e0d\u662f\u4e00\u56de\u4e8b1. \u7f16\u8bd1\u94fe\u63a5\u9636\u6bb52. \u7a0b\u5e8f\u8fd0\u884c\u9636\u6bb5\u4e09\u3001\u7528 ldd \u67e5\u770b\u52a8\u6001\u4f9d\u8d56\u56db\u3001\u52a8\u6001\u94fe\u63a5\u5668\u9ed8\u8ba4\u53bb\u54ea\u91cc\u627e\u5e93\u4e94\u3001\u89e3\u51b3\u65b9\u6848\u4e00&#xff1a;\u62f7\u8d1d\u5230\u7cfb\u7edf\u5e93\u8def\u5f84\u516d\u3001\u89e3\u51b3\u65b9\u6848\u4e8c&#xff1a;\u5728\u7cfb\u7edf\u8def\u5f84\u5efa\u7acb\u8f6f\u94fe\u63a5\u4e03\u3001\u89e3\u51b3\u65b9\u6848\u4e09&#xff1a;\u8bbe\u7f6e LD_LIBRARY_PATH\u516b\u3001\u89e3\u51b3\u65b9\u6848\u56db&#xff1a;\u914d\u7f6e ld.so.conf.d \u5e76\u6267\u884c ldconfig\u4e5d\u3001\u89e3\u51b3\u65b9\u6848\u4e94&#xff1a;\u7f16\u8bd1\u65f6\u5199\u5165 rpath\u5341\u3001\u4e94\u79cd\u65b9\u6848\u5bf9\u6bd4\u5341\u4e00\u3001\u4e3a\u4ec0\u4e48\u9759","og_url":"https:\/\/www.wsisp.com\/helps\/93194.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-11T23:33:26+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260811233323-6a7bb143696d7.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/93194.html","url":"https:\/\/www.wsisp.com\/helps\/93194.html","name":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-11T23:33:26+00:00","dateModified":"2026-08-11T23:33:26+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/93194.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/93194.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/93194.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux\u6307\u5357\u3011\u52a8\u9759\u6001\u5e93\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u52a8\u6001\u5e93\u8fd0\u884c\u62a5\u9519\u6392\u67e5\uff1a\u4e3a\u4ec0\u4e48\u7f16\u8bd1\u901a\u8fc7\uff0c\u8fd0\u884c\u5374\u627e\u4e0d\u5230 .so"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/93194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=93194"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/93194\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/93193"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=93194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=93194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=93194"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=93194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}