{"id":21406,"date":"2024-11-19T09:29:11","date_gmt":"2024-11-19T01:29:11","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21406\/"},"modified":"2024-11-19T09:29:11","modified_gmt":"2024-11-19T01:29:11","slug":"vscode%e6%80%8e%e4%b9%88%e9%85%8d%e7%bd%aec%e8%af%ad%e8%a8%80%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21406\/","title":{"rendered":"vscode\u600e\u4e48\u914d\u7f6ec\u8bed\u8a00\u73af\u5883"},"content":{"rendered":"<blockquote><p>\n  \u914d\u7f6e vscode \u7684 c \u8bed\u8a00\u73af\u5883\u5305\u62ec\uff1a\u5b89\u88c5 visual studio code\u3002\u5b89\u88c5 c\/c++ \u6269\u5c55\u3002\u8bbe\u7f6e\u7f16\u8bd1\u5668\u8def\u5f84\uff0c\u5982 mingw \u7f16\u8bd1\u5668\u3002\u914d\u7f6e\u8c03\u8bd5\u5668\uff0c\u8bbe\u7f6e\u914d\u7f6e\u540d\u79f0\u3001\u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u548c gdb\/lldb \u547d\u4ee4\u3002\u521b\u5efa c \u6587\u4ef6\u5e76\u7f16\u5199\u4ee3\u7801\u3002\u6309 f5 \u7f16\u8bd1\u548c\u8fd0\u884c\u7a0b\u5e8f\uff0c\u5728\u201c\u8c03\u8bd5\u63a7\u5236\u53f0\u201d\u89c6\u56fe\u4e2d\u67e5\u770b\u8f93\u51fa\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/27\/2024052715003455278.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u914d\u7f6ec\u8bed\u8a00\u73af\u5883\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u914d\u7f6ec\u8bed\u8a00\u73af\u5883\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u914d\u7f6e VSCode \u7684 C \u8bed\u8a00\u73af\u5883<\/strong><\/p>\n<p><strong>\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5 Visual Studio Code<\/strong><\/p>\n<ul>\n<li>\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5 Visual Studio Code\uff1ahttps:\/\/code.visualstudio.com\/<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5 C\/C++ \u6269\u5c55<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 VSCode\uff0c\u5728\u201c\u6269\u5c55\u201d\u89c6\u56fe\u4e2d\u641c\u7d22\u5e76\u5b89\u88c5\u201cC\/C++\u201d\u6269\u5c55\u3002<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e09\u6b65\uff1a\u8bbe\u7f6e\u7f16\u8bd1\u5668<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u5355\u51fb\u83dc\u5355\u680f\u4e2d\u7684\u201c\u6587\u4ef6\u201d &gt; \u201c\u9996\u9009\u9879\u201d &gt; \u201c\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\n<p>\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cC_Cpp.default.compilerPath\u201d\uff0c\u7136\u540e\u8bbe\u7f6e\u7f16\u8bd1\u5668\u8def\u5f84\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e MinGW \u7f16\u8bd1\u5668\uff1a<\/p>\n<pre>C:MinGWingcc.exe<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\u91cd\u542f VSCode\u3002<\/li>\n<\/ul>\n<p><strong>\u7b2c\u56db\u6b65\uff1a\u914d\u7f6e\u8c03\u8bd5\u5668<\/strong><\/p>\n<ul>\n<li>\u5355\u51fb\u83dc\u5355\u680f\u4e2d\u7684\u201c\u542f\u52a8\u8c03\u8bd5\u201d\u6309\u94ae\u3002<\/li>\n<li>\u5728\u201c\u8c03\u8bd5\u63a7\u5236\u53f0\u201d\u89c6\u56fe\u4e2d\uff0c\u5355\u51fb\u9f7f\u8f6e\u56fe\u6807\u5e76\u9009\u62e9\u201c\u6dfb\u52a0\u914d\u7f6e&#8230;\u201d &gt; \u201cC++ (GDB\/LLDB)\u201d\u3002<\/li>\n<li>\u5728\u201c\u540d\u79f0\u201d\u5b57\u6bb5\u4e2d\u8f93\u5165\u914d\u7f6e\u540d\u79f0\uff0c\u4f8b\u5982\u201c\u6211\u7684 C++ \u9879\u76ee\u201d\u3002<\/li>\n<li>\u5728\u201c\u7a0b\u5e8f\u201d\u5b57\u6bb5\u4e2d\u8f93\u5165\u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u3002<\/li>\n<li>\u5728\u201c\u8c03\u8bd5\u7c7b\u578b\u201d\u4e2d\u9009\u62e9\u201cGDB\/LLDB\u201d\u3002<\/li>\n<li>\n<p>\u5728\u201cGDB\/LLDB \u547d\u4ee4\u201d\u4e2d\u8f93\u5165\uff1a<\/p>\n<pre>gdb<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\u70b9\u51fb\u201c\u4fdd\u5b58\u201d\u6309\u94ae\u3002<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e94\u6b65\uff1a\u521b\u5efa C \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u5728 VSCode \u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\uff0c\u5e76\u4ee5 .c \u4e3a\u6269\u5c55\u540d\u4fdd\u5b58\u3002\u4f8b\u5982\uff0c\u201chello.c\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u7b2c\u516d\u6b65\uff1a\u7f16\u5199\u4ee3\u7801<\/strong><\/p>\n<ul>\n<li>\n<p>\u5728\u6587\u4ef6\u4e2d\u8f93\u5165\u4ee5\u4e0b C \u8bed\u8a00\u4ee3\u7801\uff1a<\/p>\n<pre>#include &lt;stdio.h&gt;\n\nint main() {\n  printf(\"Hello, world!\n\");\n  return 0;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e03\u6b65\uff1a\u7f16\u8bd1\u548c\u8fd0\u884c\u7a0b\u5e8f<\/strong><\/p>\n<ul>\n<li>\u6309 F5 \u7f16\u8bd1\u5e76\u8fd0\u884c\u7a0b\u5e8f\u3002<\/li>\n<li>\u5728\u201c\u8c03\u8bd5\u63a7\u5236\u53f0\u201d\u89c6\u56fe\u4e2d\u53ef\u4ee5\u770b\u5230\u8f93\u51fa\u201cHello, world!\u201d\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u914d\u7f6e\u73af\u5883\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>\u914d\u7f6e vscode \u7684 c \u8bed\u8a00\u73af\u5883\u5305\u62ec\uff1a\u5b89\u88c5 visual studio code\u3002\u5b89\u88c5 c\/c++ \u6269\u5c55\u3002\u8bbe\u7f6e\u7f16\u8bd1\u5668\u8def\u5f84\uff0c\u5982 mingw \u7f16\u8bd1\u5668\u3002\u914d\u7f6e\u8c03\u8bd5\u5668\uff0c\u8bbe\u7f6e\u914d\u7f6e\u540d\u79f0\u3001\u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u548c gdb\/lldb \u547d\u4ee4\u3002\u521b\u5efa c \u6587\u4ef6\u5e76\u7f16\u5199\u4ee3\u7801\u3002\u6309 f5 \u7f16\u8bd1\u548c\u8fd0\u884c\u7a0b\u5e8f\uff0c\u5728\u201c\u8c03\u8bd5\u63a7\u5236\u53f0\u201d\u89c6\u56fe\u4e2d\u67e5\u770b\u8f93\u51fa\u3002 \u5982\u4f55\u914d\u7f6e VSCode \u7684 C \u8bed\u8a00\u73af\u5883 \u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5 Visual Studio Code \u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5 Visual Studio Code\uff1ahttps:\/\/code.visualstudio.com\/ \u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5 C\/C++ \u6269\u5c55 \u6253\u5f00 VSCode\uff0c\u5728\u201c\u6269\u5c55\u201d\u89c6\u56fe\u4e2d\u641c\u7d22\u5e76\u5b89\u88c5\u201cC\/C++\u201d\u6269\u5c55\u3002 \u7b2c\u4e09\u6b65\uff1a\u8bbe\u7f6e\u7f16\u8bd1\u5668 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u5355\u51fb\u83dc\u5355\u680f\u4e2d\u7684\u201c\u6587\u4ef6\u201d &gt; \u201c\u9996\u9009\u9879\u201d &gt; \u201c\u8bbe\u7f6e\u201d\u3002 \u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cC_Cpp.default.compilerPath\u201d\uff0c\u7136\u540e\u8bbe\u7f6e\u7f16\u8bd1\u5668\u8def\u5f84\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e MinGW \u7f16\u8bd1\u5668\uff1a C:MinGWingcc.exe \u767b\u5f55\u540e\u590d\u5236 \u91cd\u542f VSCode\u3002 \u7b2c\u56db\u6b65\uff1a\u914d\u7f6e\u8c03\u8bd5\u5668 \u5355\u51fb\u83dc\u5355\u680f\u4e2d\u7684\u201c\u542f\u52a8\u8c03\u8bd5\u201d\u6309\u94ae\u3002 \u5728\u201c\u8c03\u8bd5\u63a7\u5236\u53f0\u201d\u89c6\u56fe\u4e2d\uff0c\u5355\u51fb\u9f7f\u8f6e\u56fe\u6807\u5e76\u9009\u62e9\u201c\u6dfb\u52a0\u914d\u7f6e&#8230;\u201d &gt; \u201cC++ [&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-21406","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21406","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=21406"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21406\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}