{"id":21447,"date":"2024-11-19T10:35:32","date_gmt":"2024-11-19T02:35:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21447\/"},"modified":"2024-11-19T10:35:32","modified_gmt":"2024-11-19T02:35:32","slug":"vscode%e6%80%8e%e4%b9%88%e6%89%a7%e8%a1%8c%e7%bc%96%e8%af%91","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21447\/","title":{"rendered":"vscode\u600e\u4e48\u6267\u884c\u7f16\u8bd1"},"content":{"rendered":"<blockquote><p>\n  \u5728 visual studio code \u4e2d\u7f16\u8bd1\u4ee3\u7801\u7684\u6b65\u9aa4\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u7f16\u8bd1\u5668\u3002\u6253\u5f00 vscode \u5e76\u9009\u62e9\u4ee3\u7801\u76ee\u5f55\u3002\u914d\u7f6e\u7f16\u8bd1\u4efb\u52a1\u3002\u8fd0\u884c\u7f16\u8bd1\u4efb\u52a1\u3002\u8c03\u6574\u7f16\u8bd1\u547d\u4ee4\uff08\u6839\u636e\u9700\u8981\uff09\u3002\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e\u5feb\u901f\u7f16\u8bd1\uff08ctrl + shift + b\/cmd + option + b\uff09\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/29\/2024052913481951555.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u6267\u884c\u7f16\u8bd1\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u6267\u884c\u7f16\u8bd1\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5728 Visual Studio Code \u4e2d\u7f16\u8bd1\u4ee3\u7801<\/strong><\/p>\n<p>\u5728 Visual Studio Code (VSCode) \u4e2d\u7f16\u8bd1\u4ee3\u7801\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5\u5fc5\u8981\u7684\u7f16\u8bd1\u5668<\/strong><\/p>\n<p>\u6839\u636e\u9700\u8981\u7f16\u8bd1\u7684\u4ee3\u7801\u7c7b\u578b\uff0c\u5b89\u88c5\u76f8\u5e94\u7684\u7f16\u8bd1\u5668\u3002\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>C\/C++\uff1a\u5b89\u88c5 MinGW \u6216 Clang<\/li>\n<li>Java\uff1a\u5b89\u88c5 Java Development Kit (JDK)<\/li>\n<li>Python\uff1a\u5b89\u88c5 Python \u89e3\u91ca\u5668<\/li>\n<\/ul>\n<p><strong>2. \u6253\u5f00 VSCode \u5e76\u9009\u62e9\u4ee3\u7801\u76ee\u5f55<\/strong><\/p>\n<p>\u6253\u5f00 VSCode \u5e76\u7528\u5176\u6253\u5f00\u5305\u542b\u60a8\u8981\u7f16\u8bd1\u4ee3\u7801\u7684\u76ee\u5f55\u3002<\/p>\n<p><strong>3. \u914d\u7f6e\u7f16\u8bd1\u4efb\u52a1<\/strong><\/p>\n<p>\u5728 VSCode \u4e2d\uff0c\u6253\u5f00\u201c\u4efb\u52a1\u201d\u9009\u9879\u5361\uff08\u901a\u5e38\u4f4d\u4e8e\u5e95\u90e8\uff09\u3002\u7136\u540e\uff0c\u5355\u51fb\u201c\u521b\u5efa\u4efb\u52a1\u201d\u56fe\u6807\u5e76\u9009\u62e9\u201c\u5176\u4ed6\u4efb\u52a1\u201d\u3002\u8fd9\u5c06\u521b\u5efa\u4ee5\u4e0b task.json \u6587\u4ef6\uff1a<\/p>\n<pre>{\n  \"version\": \"2.0.0\",\n  \"tasks\": [\n    {\n      \"label\": \"compile\",\n      \"type\": \"shell\",\n      \"command\": \"g++\", \/\/ \u6839\u636e\u7f16\u8bd1\u5668\u4fee\u6539\n      \"args\": [\"main.cpp\", \"-o\", \"main\"], \/\/ \u6839\u636e\u9700\u8981\u8c03\u6574\n      \"group\": \"build\"\n    }\n  ]\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u8fd0\u884c\u7f16\u8bd1\u4efb\u52a1<\/strong><\/p>\n<p>\u5728\u4efb\u52a1\u9009\u9879\u5361\u4e2d\uff0c\u627e\u5230\u60a8\u521b\u5efa\u7684\u7f16\u8bd1\u4efb\u52a1\u5e76\u5355\u51fb\u201c\u8fd0\u884c\u4efb\u52a1\u201d\u56fe\u6807\u3002\u8fd9\u5c06\u8fd0\u884c\u7f16\u8bd1\u547d\u4ee4\uff0c\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u6216\u5e93\u3002<\/p>\n<p><strong>5. \u8c03\u6574\u7f16\u8bd1\u547d\u4ee4<\/strong><\/p>\n<p>\u6839\u636e\u9700\u8981\u7f16\u8bd1\u7684\u4ee3\u7801\u7c7b\u578b\uff0c\u8c03\u6574 task.json \u6587\u4ef6\u4e2d\u7684\u201c\u547d\u4ee4\u201d\u548c\u201c\u53c2\u6570\u201d\u8bbe\u7f6e\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e Python \u4ee3\u7801\uff0c\u53ef\u4ee5\u5c06\u201c\u547d\u4ee4\u201d\u66f4\u6539\u4e3a\u201c\u201d\u5e76\u6dfb\u52a0\u201cmain.py\u201d\u53c2\u6570\u3002<\/p>\n<p><strong>6. \u5feb\u6377\u65b9\u5f0f<\/strong><\/p>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u952e\u76d8\u5feb\u6377\u952e\u5feb\u901f\u8fd0\u884c\u7f16\u8bd1\u4efb\u52a1\uff1a<\/p>\n<ul>\n<li>Windows\/Linux\uff1aCtrl + Shift + B<\/li>\n<li>Mac\uff1aCmd + Option + B<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u5728 Visual Studio Code \u4e2d\u8f7b\u677e\u7f16\u8bd1\u4ee3\u7801\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u6267\u884c\u7f16\u8bd1\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 visual studio code \u4e2d\u7f16\u8bd1\u4ee3\u7801\u7684\u6b65\u9aa4\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u7f16\u8bd1\u5668\u3002\u6253\u5f00 vscode \u5e76\u9009\u62e9\u4ee3\u7801\u76ee\u5f55\u3002\u914d\u7f6e\u7f16\u8bd1\u4efb\u52a1\u3002\u8fd0\u884c\u7f16\u8bd1\u4efb\u52a1\u3002\u8c03\u6574\u7f16\u8bd1\u547d\u4ee4\uff08\u6839\u636e\u9700\u8981\uff09\u3002\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e\u5feb\u901f\u7f16\u8bd1\uff08ctrl + shift + b\/cmd + option + b\uff09\u3002 \u5728 Visual Studio Code \u4e2d\u7f16\u8bd1\u4ee3\u7801 \u5728 Visual Studio Code (VSCode) \u4e2d\u7f16\u8bd1\u4ee3\u7801\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a 1. \u5b89\u88c5\u5fc5\u8981\u7684\u7f16\u8bd1\u5668 \u6839\u636e\u9700\u8981\u7f16\u8bd1\u7684\u4ee3\u7801\u7c7b\u578b\uff0c\u5b89\u88c5\u76f8\u5e94\u7684\u7f16\u8bd1\u5668\u3002\u4f8b\u5982\uff1a C\/C++\uff1a\u5b89\u88c5 MinGW \u6216 Clang Java\uff1a\u5b89\u88c5 Java Development Kit (JDK) Python\uff1a\u5b89\u88c5 Python \u89e3\u91ca\u5668 2. \u6253\u5f00 VSCode \u5e76\u9009\u62e9\u4ee3\u7801\u76ee\u5f55 \u6253\u5f00 VSCode \u5e76\u7528\u5176\u6253\u5f00\u5305\u542b\u60a8\u8981\u7f16\u8bd1\u4ee3\u7801\u7684\u76ee\u5f55\u3002 3. \u914d\u7f6e\u7f16\u8bd1\u4efb\u52a1 \u5728 VSCode \u4e2d\uff0c\u6253\u5f00\u201c\u4efb\u52a1\u201d\u9009\u9879\u5361\uff08\u901a\u5e38\u4f4d\u4e8e\u5e95\u90e8\uff09\u3002\u7136\u540e\uff0c\u5355\u51fb\u201c\u521b\u5efa\u4efb\u52a1\u201d\u56fe\u6807\u5e76\u9009\u62e9\u201c\u5176\u4ed6\u4efb\u52a1\u201d\u3002\u8fd9\u5c06\u521b\u5efa\u4ee5\u4e0b task.json \u6587\u4ef6\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-21447","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=21447"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21447\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}