{"id":290753,"date":"2024-04-06T21:15:06","date_gmt":"2024-04-06T13:15:06","guid":{"rendered":"https:\/\/gulass.cn\/ljcxlbccycld.html"},"modified":"2024-04-06T21:15:06","modified_gmt":"2024-04-06T13:15:06","slug":"ljcxlbccycld","status":"publish","type":"post","link":"https:\/\/gulass.cn\/ljcxlbccycld.html","title":{"rendered":"\u96f6\u57fa\u7840\u5b66Linux\u7f16\u7a0b\uff01\u4ece\u9884\u5904\u7406\u5230\u94fe\u63a5\uff0c\u4e00\u6b21get\u660e\u767d"},"content":{"rendered":"

\u4e00\u3001\u7406\u89e3\u7f16\u8bd1\u8fc7\u7a0b<\/b><\/p>\n

\u5728 Linux<\/a> \u73af\u5883\u4e0b\uff0c\u6784\u5efa C \u7a0b\u5e8f\u7684\u5173\u952e\u73af\u8282\u4fbf\u662f\u7f16\u8bd1\u8fc7\u7a0b\u3002\u5168\u9762\u4e86\u89e3\u6b64\u8fc7\u7a0b\u5bf9\u9ad8\u6548\u5730\u5b8c\u6210\u7a0b\u5e8f\u7814\u53d1\u8d77\u7740\u81f3\u5173\u91cd\u8981\u7684\u4f5c\u7528\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u8be5\u8fc7\u7a0b\u5305\u542b\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u4ee5\u53ca\u94fe\u63a5\u56db\u5927\u6b65\u9aa4\u3002\u9996\u5148\uff0c\u9884\u5904\u7406\u9636\u6bb5\uff0c\u7f16\u8bd1\u5668\u8d1f\u8d23\u6574\u5408\u6e90\u7801\u4e2d\u8bf8\u5982#include \u4e0e#define \u8fd9\u7c7b\u9884\u5b9a\u4e49\u6307\u4ee4\uff0c\u968f\u4e4b\u8f93\u51fa\u7ecf\u5b8f\u66ff\u6362\u53ca\u6761\u4ef6\u7f16\u8bd1\u5904\u7406\u8fc7\u540e\u7684\u4e2d\u95f4\u4ee3\u7801\u6587\u6863\u3002\u7136\u540e\u8fdb\u5165\u7f16\u8bd1\u9636\u6bb5\uff0c\u7f16\u8bd1\u5668\u4fbf\u5c06\u4e2d\u95f4\u4ee3\u7801\u505a\u8fdb\u4e00\u6b65\u8f6c\u5316\uff0c\u8f6c\u53d8\u6210\u6c47\u7f16\u4ee3\u7801\u3002\u63a5\u4e0b\u6765\uff0c\u6c47\u7f16\u9636\u6bb5\uff0c\u6c47\u7f16\u5668\u4f1a\u5c06\u6c47\u7f16\u4ee3\u7801\u5347\u534e\u4e3a\u76ee\u6807\u6587\u4ef6\u3002\u672b\u4e86\uff0c\u5728\u94fe\u63a5\u9636\u6bb5\uff0c\u94fe\u63a5\u5668\u5c06\u76ee\u6807\u6587\u4ef6\u4e0e\u6240\u9700\u5e93\u6587\u4ef6\u5173\u8054\u8d77\u6765\uff0c\u6700\u7ec8\u751f\u6210\u53ef\u4ee5\u8fd0\u884c\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n

\u5b9e\u9645\u5de5\u4f5c\u73af\u8282\u4e2d\uff0c\u9700\u8fd0\u7528\u5404\u7c7b\u5de5\u5177\u8f85\u52a9\u6b65\u9aa4\u8fbe\u6210\uff0c\u5982GCC\uff08Linux\u5e73\u53f0\u4e0a\u5e7f\u6cdb\u5e94\u7528\u7684C\u8bed\u8a00\u7f16\u8bd1\u5668\uff09\u5373\u80fd\u534f\u52a9\u6211\u4eec\u5b8c\u6210\u7531\u6e90\u7801\u81f3\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u7f16\u8bd1\u6d41\u7a0b\u3002<\/p>\n

\u4e8c\u3001\u51c6\u5907\u5de5\u4f5c<\/b><\/p>\n

\u5728\u7f16\u8bd1C\u7a0b\u5e8f\u524d\uff0c\u9700\u505a\u4ee5\u4e0b\u51c6\u5907\u5de5\u4f5c\uff1a\u5148\u68c0\u67e5\u7cfb\u7edf<\/a>\u4e2d\u662f\u5426\u5df2\u5b89\u88c5\u5982gcc\u8fd9\u6837\u7684\u7f16\u8bd1\u5668\uff1b\u82e5\u672a\u5b89\u88c5\uff0c\u53ef\u5229\u7528\u5305\u7ba1\u7406\u5668\u5b8c\u6210\u5b89\u88c5\u3002\u53ef\u901a\u8fc7\u5728\u7ec8\u7aef\u8f93\u5165gcc --version\u9a8c\u8bc1\u5b89\u88c5\u60c5\u51b5\u3002<\/p>\n

\u7f16\u8bd1\u7a0b\u5e8f\u5c5e\u4e8e_\u7f16\u8bd1\u7a0b\u5e8f\u7684\u6700\u7ec8\u76ee\u6807\u662f_linux\u5982\u4f55\u7f16\u8bd1c\u7a0b\u5e8f<\/p>\n

\u5176\u6b21\uff0c\u5e94\u9884\u5907\u597d\u6e90\u7801\u6587\u4ef6\u3002\u4e00\u822c\u800c\u8a00\uff0cC\u4ee3\u7801\u5e38\u4ee5.c\u4e3a\u6269\u5c55\u540d\u4fdd\u5b58\u3002\u52a1\u5fc5\u786e\u4fdd\u6e90\u4ee3\u7801\u65e0\u8bed\u6cd5\u53ca\u903b\u8f91\u6027\u9519\u8bef\u3002<\/p>\n

\u4e09\u3001\u7f16\u5199Makefile<\/b><\/p>\n

Makefile\u4e3a\u7ba1\u7406\u9879\u76ee\u5404\u6e90\u6587\u4ef6\u95f4\u4f9d\u8d56\u6027\u7684\u6587\u672c\u6587\u4ef6\uff0c\u85c9\u6b64\u5f15\u5bfc\u7cfb\u7edf\u5b9e\u73b0\u81ea\u52a8\u5316\u6784\u5efa\u3002\u5b8c\u6574\u7684Makefile\u5206\u4e3a\u76ee\u6807\u3001\u4f9d\u8d56\u53ca\u6267\u884c\u6307\u4ee4\u4e09\u8981\u7d20\u3002<\/p>\n

\u6784\u5efa Makefile \u65f6\uff0c\u5fc5\u987b\u660e\u786e\u5b9a\u4e49\u6700\u7ec8\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u540d\u4e3a\"\u76ee\u6807\uff08target\uff09\";\u6240\u9700\u4f9d\u8d56\u7684\u6e90\u6587\u4ef6\u5219\u6784\u6210\u4e86\"\u4f9d\u8d56\uff08dependency\uff09\";\u540c\u65f6\u9700\u9644\u4e0a\u751f\u6210\u76ee\u6807\u7684\u8be6\u7ec6\u6b65\u9aa4\uff0c\u4fbf\u662f\u6240\u8c13\u7684\"\u547d\u4ee4<\/a>\uff08command\uff09\"\u3002<\/p>\n

\u56db\u3001\u6267\u884c\u7f16\u8bd1<\/b><\/p>\n

\u5728\u59a5\u5584\u5b8c\u6210\u9884\u5907\u6b65\u9aa4\u5e76\u786e\u4fddMakefile\u6709\u6548\u8fd0\u4f5c\u540e\uff0c\u4fbf\u53ef\u542f\u52a8\u7f16\u8bd1\u6d41\u7a0b\u3002\u9996\u5148\u5728\u7ec8\u7aef\u8f93\u5165\u76ee\u7684\u5730\u4e3a\u5b58\u653e\u6e90\u4ee3\u7801\u53caMakefile\u7684\u6587\u4ef6\u5939\uff0c\u7136\u540e\u952e\u5165\"make\"\u6307\u4ee4linux\u5982\u4f55\u7f16\u8bd1c\u7a0b\u5e8f<\/strong>\uff0c\u6b63\u5f0f\u542f\u52a8\u81ea\u52a8\u6784\u5efa\u8fc7\u7a0b\u3002<\/p>\n

\u5728 Makefile \u4e2d\uff0c`make`\u6307\u4ee4\u4f9d\u636e\u5404\u9879\u89c4\u7ae0\u5236\u5ea6\u81ea\u884c\u63a8\u8fdb\u7f16\u8bd1\u8fdb\u7a0blinux\u5982\u4f55\u7f16\u8bd1c\u7a0b\u5e8f<\/strong>\uff0c\u5448\u73b0\u51fa\u4e00\u683c\u8c03\u8bd5\u8fc7\u7a0b\u7684\u65e0\u7f1d\u8854\u63a5\u3002\u5f53\u6240\u6709\u6b65\u9aa4\u5747\u8fbe\u9884\u671f\u6807\u51c6\u540e\uff0c\u5373\u523b\u751f\u6210\u53ef\u4f9b\u8fd0\u884c\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n

\u4e94\u3001\u8c03\u8bd5\u4e0e\u4f18\u5316<\/b><\/p>\n

\u5b8c\u6210\u53ef\u6267\u884c\u6587\u4ef6\u5236\u4f5c\u540e\uff0c\u9700\u5c55\u5f00\u8c03\u8bd5\u4e0e\u4f18\u5316\u5de5\u4f5c\u3002\u8c03\u8bd5\u4efb\u52a1\u4e3b\u8981\u5728\u4e8e\u63a2\u5bfb\u5e76\u4fee\u590d\u7a0b\u5e8f\u4e2d\u7684\u7455\u75b5\uff0c\u53ef\u4f9d\u6258\u4e8eLinux\u4e0b\u7684gdb\u8c03\u8bd5\u5de5\u5177\u3002<\/p>\n

\u9664\u6b64\u4e4b\u5916\uff0c\u5728\u4f18\u5316\u5904\u7406\u4e2d\uff0c\u6211\u4eec\u53ef\u8fd0\u7528gcc\u6240\u5305\u542b\u7684\u4e00\u7cfb\u5217\u53c2\u6570\uff0c\u4f7f\u5e94\u7528\u7a0b\u5e8f\u5728\u6027\u80fd\u63d0\u5347\u4e0e\u4f53\u79ef\u7f29\u51cf\u7b49\u65b9\u9762\u5f97\u5230\u5b9e\u8d28\u6027\u7684\u6539\u5584\u3002<\/p>\n

\u7f16\u8bd1\u7a0b\u5e8f\u5c5e\u4e8e_linux\u5982\u4f55\u7f16\u8bd1c\u7a0b\u5e8f_\u7f16\u8bd1\u7a0b\u5e8f\u7684\u6700\u7ec8\u76ee\u6807\u662f<\/p>\n

\u516d\u3001\u4ea4\u53c9\u7f16\u8bd1<\/b><\/p>\n

\u5728\u6709\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u5728\u67d0\u4e00\u67b6\u6784\u73af\u5883\u4e2d\u8fdb\u884c\u7f16\u7a0b\uff0c\u800c\u5728\u53e6\u4e00\u67b6\u6784\u73af\u5883\u4e2d\u8fd0\u884c\uff0c\u8fd9\u65f6\u4fbf\u9700\u8981\u8fdb\u884c\u4ea4\u53c9\u7f16\u8bd1\u3002\u5b83\u6d89\u53ca\u5230\u4f9d\u6258\u4e8e\u4e00\u4e2a\u5e73\u53f0\u6765\u751f\u6210\u9002\u7528\u4e8e\u53e6\u4e00\u5e73\u53f0\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n

\u5728\u5229\u7528Linux\u8fdb\u884c\u4ea4\u53c9\u7f16\u8bd1\u7684\u8fc7\u7a0b\u4e2dlinux\u5b89\u5168\u52a0\u56fa\uff0c\u5fc5\u987b\u660e\u786e\u8bbe\u5b9a\u76ee\u6807\u5e73\u53f0\u4e0e\u6240\u9700\u7684\u4ea4\u53c9\u5de5\u5177\u94fe\uff0c\u540c\u65f6\u4e5f\u8981\u9488\u5bf9\u4ea4\u53c9\u7f16\u8bd1\u73af\u5883\u5bf9Makefile\u505a\u76f8\u5e94\u4fee\u6b63\u3002<\/p>\n

\u4e03\u3001\u9759\u6001\u5e93\u4e0e\u52a8\u6001\u5e93<\/b><\/p>\n

\u5728Linux\u73af\u5883\u4e0b\uff0c\u53ef\u501f\u52a9\u9759\u6001\u4e0e\u52a8\u6001\u5e93\u4ee5\u5b9e\u73b0\u7a0b\u5e8f\u7f16\u7801\u7684\u6709\u6548\u590d\u7528\uff0c\u9664\u5c06\u8bf8\u9879\u4ee3\u7801\u76f4\u63a5\u8fde\u63a5\u81f3\u53ef\u6267\u884c\u6587\u4ef6\u5916\u3002<\/p>\n

\u7f16\u8bd1\u7a0b\u5e8f\u7684\u6700\u7ec8\u76ee\u6807\u662f_\u7f16\u8bd1\u7a0b\u5e8f\u5c5e\u4e8e_linux\u5982\u4f55\u7f16\u8bd1c\u7a0b\u5e8f<\/p>\n

\u9759\u6001\u5e93\u91c7\u7528\u4e00\u4e2a\u5b8c\u6574\u7684.a\u6587\u4ef6\u5f62\u5f0f\u5c01\u88c5\u6240\u6709\u5173\u8054\u51fd\u6570\uff0c\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u7684\u94fe\u63a5\u9636\u6bb5\uff0c\u8fd9\u4e9b\u5173\u8054\u51fd\u6570\u5c06\u88ab\u9010\u4e00\u590d\u5236\u5230\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e4b\u4e2d\u3002\u76f8\u53cd\uff0c\u52a8\u6001\u5e93\u5219\u5c06\u51fd\u6570\u4ee5.so\u6587\u4ef6\u7684\u683c\u5f0f\u6253\u5305\u5b58\u50a8\uff0c\u4f7f\u7528\u671f\u95f4\u4e3b\u8981\u4f9d\u8d56OS\u7684\u52a8\u6001\u8f7d\u5165\u529f\u80fd\u8fdb\u884c\u8c03\u7528\u3002<\/p>\n

\u8fd0\u7528\u9759\u6001\u5e93\u4e0e\u52a8\u6001\u5e93\u80fd\u663e\u8457\u63d0\u5347\u4ee3\u7801\u7684\u91cd\u590d\u5229\u7528\u7387\uff0c\u4e5f\u66f4\u4fbf\u4e8e\u8f6f\u4ef6\u7684\u5347\u7ea7\u53ca\u7ef4\u62a4\u3002<\/p>\n

\u516b\u3001\u6301\u7eed\u96c6\u6210\u4e0e\u81ea\u52a8\u5316\u6784\u5efa<\/b><\/p>\n

\u6301\u7eed\u96c6\u6210\u4e43\u8f6f\u4ef6\u7814\u53d1\u5b9e\u8df5\u4e4b\u6cd5\uff0c\u5b83\u4f7f\u6bcf\u4e2a\u6e90\u7801\u63d0\u4ea4\u81ea\u52a8\u89e6\u53d1\u6784\u5efa\u8fc7\u7a0b\uff0c\u4e14\u901a\u8fc7\u8fd0\u884c\u6d4b\u8bd5\u6848\u4f8b\u4e88\u4ee5\u54c1\u8d28\u9a8c\u8bc1red hat linux\u4e0b\u8f7d\uff0c\u786e\u4fdd\u65b0\u8d21\u732e\u7b26\u5408\u8d28\u91cf\u6807\u51c6\u3002<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\u5229\u7528\u5982Jenkins\u8fd9\u7c7b\u7684\u6301\u7eed\u96c6\u6210\u6280\u672f\uff0c\u4e0d\u4ec5\u80fd\u6709\u6548\u5b9e\u73b0\u6301\u7eed\u96c6\u6210\u548c\u81ea\u52a8\u5316\u6784\u5efa\uff0c\u8fd8\u53ef\u663e\u8457\u63d0\u5347\u56e2\u961f\u534f\u540c\u4f5c\u4e1a\u7684\u6548\u7387\u53ca\u9879\u76ee\u6210\u54c1\u8d28\u91cf\u3002<\/p>\n

\u4e5d\u3001\u5b66\u4e60\u8d44\u6e90\u63a8\u8350<\/b><\/p>\n

\u5bf9\u4e8e\u6df1\u5ea6\u63a2\u7a76Linux\u7cfb\u7edf\u4e2dC\u4ee3\u7801\u7684\u7f16\u8bd1\u548c\u8c03\u8bd5\u6280\u5de7\u7684\u7231\u597d\u8005\u4eec\uff0c\u6211\u4eec\u4e3a\u60a8\u7cbe\u9009\u4e86\u4ee5\u4e0b\u4f18\u8d28\u7684\u5b66\u4e60\u6e20\u9053\uff1a<\/p>\n

1.\u300a\u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf\u300b<\/p>\n

2. GNU Make\u5b98\u65b9\u6587\u6863<\/p>\n

3. gdb\u8c03\u8bd5\u5668\u624b\u518c<\/p>\n","protected":false},"excerpt":{"rendered":"

\u7a0b\u5e8f\u7684\u5173\u952e\u73af\u8282\u4fbf\u662f\u7f16\u8bd1\u8fc7\u7a0b\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u8be5\u8fc7\u7a0b\u5305\u542b\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u4ee5\u53ca\u94fe\u63a5\u56db\u5927\u6b65\u9aa4\u3002\u7136\u540e\u8fdb\u5165\u7f16\u8bd1\u9636\u6bb5\uff0c\u7f16\u8bd1\u5668\u4fbf\u5c06\u4e2d\u95f4\u4ee3\u7801\u505a\u8fdb\u4e00\u6b65\u8f6c\u5316\uff0c\u8f6c\u53d8\u6210\u6c47\u7f16\u4ee3\u7801\u3002\u5b9e\u9645\u5de5\u4f5c\u73af\u8282\u4e2d\uff0c\u9700\u8fd0\u7528\u5404\u7c7b\u5de5\u5177\u8f85\u52a9\u6b65\u9aa4\u8fbe\u6210\uff0c\u5982GCC\uff08Linux\u5e73\u53f0\u4e0a\u5e7f\u6cdb\u5e94\u7528\u7684C\u8bed\u8a00\u7f16\u8bd1\u5668\uff09\u5373\u80fd\u534f\u52a9\u6211\u4eec\u5b8c\u6210\u7531\u6e90\u7801\u81f3\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u7f16\u8bd1\u6d41\u7a0b\u3002<\/p>\n","protected":false},"author":1,"featured_media":290754,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-290753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/290753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=290753"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/290753\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/290754"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=290753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=290753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=290753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}