{"id":292674,"date":"2024-08-20T05:16:20","date_gmt":"2024-08-19T21:16:20","guid":{"rendered":"https:\/\/lrxjmw.cn\/lazgxsbzqsaz.html"},"modified":"2024-08-20T05:16:20","modified_gmt":"2024-08-19T21:16:20","slug":"lazgxsbzqsaz","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lazgxsbzqsaz.html","title":{"rendered":"linux \u5b89\u88c5 gcc Linux \u65b0\u624b\u5fc5\u77e5\uff1a\u8f7b\u677e\u5b89\u88c5 GCC\uff0c\u5f00\u542f\u7f16\u7a0b\u5947\u5999\u4e4b\u65c5"},"content":{"rendered":"

\u524d\u8a00\uff1a\u4e3a\u4ec0\u4e48\u6211\u4eec\u8981\u5728 Linux<\/a> \u4e0a\u5b89\u88c5 GCC\uff1f<\/b><\/p>\n

\u60a8\u81ea\u79f0Linux\u65b0\u624b\uff1f\u65e0\u9700\u62c5\u5fe7\uff0c\u6211\u4ea6\u662f\u4ece\u96f6\u8d77\u6b65\u3002\u7136\u9700\u77e5\uff0cGCC\u4e43\u7f16\u7a0b\u9886\u57df\u5de8\u64d8\u3002\u65e0\u6b64\u795e\u5668\uff0c\u7f16\u5199\u4ee3\u7801\u72b9\u5982\u6f2b\u6f2b\u957f\u591c\u4e2d\u6478\u7d22\u3002\u6545\u4eca\u65e5\uff0c\u8ba9\u6211\u5f15\u9886\u5927\u5bb6\u8fdb\u5165GCC\u7684\u5947\u5999\u4e16\u754c\uff0c\u5e76\u534f\u52a9\u60a8\u8f7b\u677e\u5b8c\u6210Linux\u73af\u5883\u4e0b\u7684\u5b89\u88c5\u914d\u7f6e\uff01<\/p>\n

\u7b2c\u4e00\u6b65\uff1a\u66f4\u65b0\u4f60\u7684\u7cfb\u7edf<\/a><\/b><\/p>\n

\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u7684Linux\u7cfb\u7edf\u4e3a\u6700\u65b0\u7248\u672c\u3002\u6b64\u4e3e\u72b9\u5982\u5bf9\u8bbe\u5907\u8fdb\u884c\u66f4\u65b0\u6e05\u6d01\uff0c\u629b\u5f03\u65e7\u6709\u8f6f\u4ef6\uff0c\u4ee3\u4e4b\u4ee5\u65b0\u7115\u751f\u673a\u3002\u8bf7\u8f93\u5165\u4ee5\u4e0b\u6307\u4ee4\u81f3\u7ec8\u7aef\uff1a<\/p>\n

\n

bash\nsudo apt update\nsudo apt upgrade\n<\/pre>\n<\/p>\n

linux \u5b89\u88c5 gcc_\u5b89\u88c5Linux\u7cfb\u7edf_\u5b89\u88c5Linux<\/p>\n

\u6613\u5982\u53cd\u638c\uff0c\u5982\u6b64\u4e00\u6765\uff0c\u7cfb\u7edf\u5f97\u4ee5\u7eaf\u51c0\u5065\u5eb7\uff0c\u4e3a\u540e\u7eedGCC\u5b89\u88c5\u5960\u5b9a\u57fa\u7840\u3002<\/p>\n

\u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5 GCC<\/b><\/p>\n

\u63a5\u7eed\u5148\u524d\u64cd\u4f5c\uff0c\u53ea\u9700\u6267\u884c\u4e00\u6761\u547d\u4ee4<\/a>\u5373\u53ef\u6b63\u786e\u8bbe\u7f6eGCC\u73af\u5883\u3002\u8bf7\u5728\u865a\u62df\u7ec8\u7aef\u8f93\u5165\uff1a<\/p>\n

sudo apt install gcc<\/p>\n

\u5728\u60a8\u4f7f\u7528GCC\u5b8c\u6210\u76f8\u5173\u64cd\u4f5c\u7684\u77ac\u95f4linux\u89c6\u9891\u6559\u7a0b\uff0c\u662f\u5426\u6709\u79cd\u8eab\u4e34\u5176\u5883\u822c\u7684\u611f\u89c9\u5982\u4f55\u5b89\u88c5linux\uff0c\u5982\u540c\u62e5\u6709\u8d85\u7ea7\u82f1\u96c4\u822c\u7684\u529b\u91cf\uff0c\u53ea\u9700\u8f7b\u70b9\u9f20\u6807\u5373\u53ef\u5524\u8d77\uff1f\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u7591\u95ee\uff0c\u65e0\u987b\u62c5\u5fe7\uff0c\u53ea\u9700\u6beb\u4e0d\u72b9\u8c6b\u5730\u8f93\u5165\"Y\"\uff0c\u4fbf\u53ef\u987a\u5229\u8fdb\u884c\u4e0b\u53bb\u3002<\/p>\n

\u7b2c\u4e09\u6b65\uff1a\u68c0\u67e5 GCC \u662f\u5426\u5b89\u88c5\u6210\u529f<\/b><\/p>\n

GCC\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u786e\u8ba4\u5176\u662f\u5426\u771f\u6b63\u7a33\u5b9a\u8fd0\u884c\u4e8e\u7cfb\u7edf\u4e2d\u3002\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\u6307\u4ee4:<\/p>\n

gcc --version<\/p>\n

\u82e5\u5df2\u67e5\u5f97GCC\u7684\u7248\u672c\u4fe1\u606f\uff0c\u5219\u610f\u5473\u7740\u60a8\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u4e0aGCC\u3002\u795d\u8d3a\u60a8\uff0c\u8fd9\u662f\u901a\u5f80\u7f16\u7a0b\u9ad8\u4eba\u4e4b\u8def\u7684\u575a\u5b9e\u4e00\u6b65\u3002<\/p>\n

\u7b2c\u56db\u6b65\uff1aGCC \u7684\u5c0f\u79d8\u5bc6<\/b><\/p>\n

\u60a8\u53ef\u80fd\u6709\u6240\u4e0d\u77e5\uff0cGCC\u8fdc\u4e0d\u6b62\u7528\u4e8e\u7f16\u8bd1C\u8bed\u8a00\u3002\u4e8b\u5b9e\u4e0a\uff0c\u5b83\u80fd\u591f\u7f16\u8bd1\u5305\u62ecC++\u3001Fortran\u5728\u5185\u7684\u4f17\u591a\u7f16\u7a0b\u8bed\u8a00\u3002\u56e0\u6b64linux \u5b89\u88c5 gcc<\/strong>\uff0c\u65e0\u8bba\u60a8\u5bf9\u54ea\u79cd\u8bed\u8a00\u6709\u7814\u7a76\uff0cGCC\u90fd\u4f1a\u662f\u60a8\u53ef\u9760\u7684\u52a9\u624b\u3002\u6216\u8bb8\uff0c\u8fd9\u4fbf\u662f\u60a8\u5bf9GCC\u611f\u5230\u6108\u53d1\u5947\u5999\u4e4b\u5904\u5427\uff01<\/p>\n

\u7b2c\u4e94\u6b65\uff1a\u5b89\u88c5\u5176\u4ed6\u76f8\u5173\u5de5\u5177<\/b><\/p>\n

\u4e3a\u4f7f\u7f16\u7a0b\u73af\u5883\u66f4\u81fb\u5b8c\u5584\uff0c\u6211\u4eec\u53ef\u9009\u62e9\u6027\u5730\u6dfb\u52a0\u5176\u4ed6\u5fc5\u8981\u5de5\u5177\uff0c\u4f8b\u5982\uff0c\u82e5\u6709\u9700\u8981\u7f16\u8bd1C++\u4ee3\u7801\uff0c\u5219\u53ef\u5b89\u88c5G++\u3002<\/p>\n

sudo apt install g++<\/p>\n

\u8fd8\u6709\uff0c\u5982\u679c\u4f60\u60f3\u8c03\u8bd5\u4ee3\u7801\uff0c\u53ef\u4ee5\u5b89\u88c5 GDB\uff1a<\/p>\n

linux \u5b89\u88c5 gcc_\u5b89\u88c5Linux\u7cfb\u7edf_\u5b89\u88c5Linux<\/p>\n

sudo apt install gdb<\/p>\n

\u8fd9\u6837\uff0c\u4f60\u7684\u7f16\u7a0b\u5de5\u5177\u7bb1\u5c31\u8d8a\u6765\u8d8a\u4e30\u5bcc\u4e86\uff01<\/p>\n

\u7b2c\u516d\u6b65\uff1aGCC \u7684\u9ad8\u7ea7\u529f\u80fd<\/b><\/p>\n

\u5c3d\u7ba1\u73b0\u5728\u4ec5\u5904\u4e8e\u521d\u6b65\u5b66\u4e60\u9636\u6bb5\uff0c\u4f46GCC\u7684\u5f3a\u5927\u529f\u80fd\u8fd8\u6709\u8bf8\u591a\u5c1a\u672a\u6316\u6398\u3002\u6bd4\u65b9\u8bf4\uff0c\u501f\u52a9\u4e8eGCC\u8fdb\u884c\u4ee3\u7801\u4f18\u5316\uff0c\u63d0\u5347\u5176\u6027\u80fd\u8868\u73b0\uff1b\u53c8\u6216\u8005\u5229\u7528GCC\u751f\u6210\u8c03\u8bd5\u8bb0\u5f55\uff0c\u8ffd\u8e2a\u5e76\u89e3\u51b3\u7a0b\u5e8f\u6f0f\u6d1e\u3002\u5982\u6b64\u770b\u6765\uff0cGCC\u786e\u5b9e\u662f\u65e5\u76ca\u589e\u957f\u7684\u5f3a\u5927\u5de5\u5177\u3002<\/p>\n

\u7b2c\u4e03\u6b65\uff1a\u5e38\u89c1\u95ee\u9898\u89e3\u51b3<\/b><\/p>\n

linux \u5b89\u88c5 gcc_\u5b89\u88c5Linux\u7cfb\u7edf_\u5b89\u88c5Linux<\/p>\n

\u5728\u5b9e\u65bd\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u96be\u514d\u4f1a\u9047\u5230\u4e00\u4e9b\u7ec6\u8282\u95ee\u9898\uff0c\u8fd9\u662f\u4e0d\u53ef\u907f\u514d\u7684\u3002\u7136\u800c\u4e0d\u5fc5\u62c5\u5fe7\uff0c\u6211\u4f1a\u5168\u529b\u534f\u52a9\u60a8\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u3002\u4f8b\u5982\uff0c\u82e5\u51fa\u73b0\u6743\u9650\u95ee\u9898\uff0c\u8bf7\u52a1\u5fc5\u4f7f\u7528\"sudo\"\u6307\u4ee4\u6267\u884c\u76f8\u5173\u64cd\u4f5c\uff1b\u5982\u9047\u7f51\u7edc\u6545\u969c\uff0c\u8bf7\u5148\u786e\u8ba4\u5df1\u65b9\u7f51\u7edc\u8fde\u63a5\u662f\u5426\u6b63\u5e38\u3002\u603b\u800c\u8a00\u4e4b\uff0c\u9762\u5bf9\u95ee\u9898\u65f6\u5207\u52ff\u60ca\u614c\u5931\u63aa\uff0c\u5c1d\u8bd5\u591a\u6b21\uff0c\u7ec8\u7a76\u80fd\u5bfb\u5f97\u89e3\u51b3\u4e4b\u9053\u3002<\/p>\n

\u7b2c\u516b\u6b65\uff1a\u5206\u4eab\u4f60\u7684 GCC \u4e4b\u65c5<\/b><\/p>\n

\u8bf7\u52a1\u5fc5\u4e0e\u60a8\u7684\u670b\u53cb\u5206\u4eab\u60a8\u5b89\u88c5GCC\u7684\u5fc3\u5f97\u4f53\u9a8c\uff01\u4f7f\u5176\u6df1\u5165\u4e86\u89e3GCC\u7684\u72ec\u7279\u9b45\u529b\u3002\u65e0\u8bba\u662f\u8bba\u575b\u53d1\u8868\u6587\u7ae0linux \u5b89\u88c5 gcc<\/strong>\uff0c\u8fd8\u662f\u793e\u4ea4\u5e73\u53f0\u5206\u4eab\u7ecf\u9a8c\uff0c\u90fd\u5c06\u52a9\u529b\u66f4\u591a\u7684\u4eba\u8fc8\u5165\u7f16\u7a0b\u9886\u57df\uff01<\/p>\n

\u7ed3\u8bed\uff1a\u4e00\u8d77\u6210\u4e3a\u7f16\u7a0b\u9ad8\u624b\u5427\uff01<\/b><\/p>\n

\u4eca\u65e5\uff0c\u6211\u4eec\u6210\u529f\u5730\u5b89\u88c5\u4e86GCC\u81f3Linux\u5e73\u53f0\u3002\u8fd9\u4f7f\u5f97\u60a8\u5bf9\u7f16\u7a0b\u9886\u57df\u6709\u4e86\u66f4\u6df1\u5165\u7684\u4e86\u89e3\u3002\u8bf7\u7ee7\u7eed\u524d\u884c\uff0c\u5c3d\u60c5\u63a2\u7d22\u5176\u4e2d\u7684\u5965\u79d8\uff0c\u60a8\u5fc5\u5c06\u4f53\u9a8c\u5230\u7f16\u7a0b\u7684\u65e0\u9650\u5feb\u4e50\u4e0e\u6311\u6218\u3002\u8bf7\u95ee\uff0c\u60a8\u662f\u5426\u5df2\u505a\u597d\u5145\u5206\u51c6\u5907\u9762\u5bf9\u8fd9\u4e9b\u7f16\u7a0b\u96be\u9898\u5462\uff1f\u671f\u5f85\u5728\u4e0b\u65b9\u8bc4\u8bba\u533a\u542c\u5230\u60a8\u7684\u771f\u77e5\u707c\u89c1\uff0c\u4e5f\u4e0d\u8981\u5fd8\u8bb0\u4e3a\u6587\u7ae0\u70b9\u8d5e\u53ca\u8f6c\u53d1\u54e6\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

linux \u5b89\u88c5 gcc\u6545\u4eca\u65e5\uff0c\u8ba9\u6211\u5f15\u9886\u5927\u5bb6\u8fdb\u5165GCC\u7684\u5947\u5999\u4e16\u754c\uff0c\u5e76\u534f\u52a9\u60a8\u8f7b\u677e\u5b8c\u6210Linux\u73af\u5883\u4e0b\u7684\u5b89\u88c5\u914d\u7f6e\uff01\u4e3a\u4f7f\u7f16\u7a0b\u73af\u5883\u66f4\u81fb\u5b8c\u5584\uff0c\u6211\u4eec\u53ef\u9009\u62e9\u6027\u5730\u6dfb\u52a0\u5176\u4ed6\u5fc5\u8981\u5de5\u5177\uff0c\u4f8b\u5982\uff0c\u82e5\u6709\u9700\u8981\u7f16\u8bd1C++\u4ee3\u7801\uff0c\u5219\u53ef\u5b89\u88c5G++\u3002\u8bf7\u52a1\u5fc5\u4e0e\u60a8\u7684\u670b\u53cb\u5206\u4eab\u60a8\u5b89\u88c5GCC\u7684\u5fc3\u5f97\u4f53\u9a8c\uff01\u7ed3\u8bed\uff1a\u4e00\u8d77\u6210\u4e3a\u7f16\u7a0b\u9ad8\u624b\u5427\uff01<\/p>\n","protected":false},"author":1,"featured_media":292675,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-292674","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/292674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=292674"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/292674\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/292675"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=292674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=292674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=292674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}