{"id":18708,"date":"2024-11-19T13:39:27","date_gmt":"2024-11-19T05:39:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18708\/"},"modified":"2024-11-19T13:39:27","modified_gmt":"2024-11-19T05:39:27","slug":"vscode%e6%80%8e%e4%b9%88%e5%86%99c%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18708\/","title":{"rendered":"vscode\u600e\u4e48\u5199c++\u4ee3\u7801"},"content":{"rendered":"<blockquote><p>\n  \u901a\u8fc7 visual studio code\uff08vscode\uff09\u7f16\u5199 c++ \u4ee3\u7801\u7684\u6b65\u9aa4\uff1a\u5b89\u88c5 c++ \u6269\u5c55\uff1b\u914d\u7f6e c++ \u7f16\u8bd1\u5668\uff1b\u65b0\u5efa c++ \u9879\u76ee\u5e76\u521b\u5efa\u4e3b\u6587\u4ef6\uff1b\u7f16\u5199 c++ \u4ee3\u7801\uff1b\u7f16\u8bd1\u5e76\u8fd0\u884c\u4ee3\u7801\uff1b\u4f7f\u7528 intellisense \u548c\u8c03\u8bd5\u5668\u7b80\u5316\u7f16\u7801\u8fc7\u7a0b\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/02\/2024080217433951127.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u5199c++\u4ee3\u7801\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u5199c++\u4ee3\u7801\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 Visual Studio Code \u7f16\u5199 C++ \u4ee3\u7801<\/strong><\/p>\n<p>\u4f7f\u7528 Visual Studio Code\uff08\u7b80\u79f0 VSCode\uff09\u7f16\u5199 C++ \u4ee3\u7801\u975e\u5e38\u7b80\u5355\u3002\u4ee5\u4e0b\u662f\u5206\u6b65\u6307\u5357\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u5b89\u88c5 C++ \u6269\u5c55<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 VSCode\uff0c\u7136\u540e\u5355\u51fb\u6269\u5c55\u56fe\u6807\uff08\u4fa7\u8fb9\u680f\u5de6\u4e0a\u89d2\u7684\u9f7f\u8f6e\u56fe\u6807\uff09\u3002<\/li>\n<li>\u641c\u7d22\u201cC++\u201d\u3002<\/li>\n<li>\u5355\u51fb\u201cC++\u201d\u6269\u5c55\u5e76\u5355\u51fb\u201c\u5b89\u88c5\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 2\uff1a\u914d\u7f6e C++ \u7f16\u8bd1\u5668<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u5355\u51fb\u201c\u4ee3\u7801\u201d\u83dc\u5355\uff0c\u7136\u540e\u9009\u62e9\u201c\u9996\u9009\u9879\u201d\u6216\u201c\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u641c\u7d22\u201cC_Cpp.default.compilerPath\u201d\uff0c\u7136\u540e\u9009\u62e9\u60a8\u8981\u4f7f\u7528\u7684\u7f16\u8bd1\u5668\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e MinGW\uff0c\u8bf7\u9009\u62e9\u201cC:\/mingw64\/bin\/g++.exe\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 3\uff1a\u65b0\u5efa C++ \u9879\u76ee<\/strong><\/p>\n<ul>\n<li>\u5355\u51fb\u201c\u6587\u4ef6\u201d\u83dc\u5355\uff0c\u7136\u540e\u9009\u62e9\u201c\u65b0\u5efa\u201d&gt;\u201c\u6587\u4ef6\u5939\u201d\u3002<\/li>\n<li>\u4e3a\u60a8\u7684\u9879\u76ee\u547d\u540d\u5e76\u5355\u51fb\u201c\u521b\u5efa\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 4\uff1a\u521b\u5efa C++ \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u5728\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\uff0c\u53f3\u952e\u5355\u51fb\u5e76\u9009\u62e9\u201c\u65b0\u5efa\u6587\u4ef6\u201d\u3002<\/li>\n<li>\u5c06\u6587\u4ef6\u547d\u540d\u4e3a\u201cmain.cpp\u201d\uff0c\u7136\u540e\u5355\u51fb\u201c\u521b\u5efa\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 5\uff1a\u7f16\u5199 C++ \u4ee3\u7801<\/strong><\/p>\n<ul>\n<li>\u5728\u201cmain.cpp\u201d\u6587\u4ef6\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<pre>#include &lt;iostream&gt;\n\nint main() {\n  std::cout &lt;&lt; \"Hello, world!\" &lt;&lt; std::endl;\n  return 0;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 6\uff1a\u7f16\u8bd1\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<ul>\n<li>\u6309 Ctrl+F5 \u6216\u5355\u51fb\u5de5\u5177\u680f\u4e2d\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\u3002<\/li>\n<li>VSCode \u5c06\u4f7f\u7528\u60a8\u914d\u7f6e\u7684\u7f16\u8bd1\u5668\u7f16\u8bd1\u60a8\u7684\u4ee3\u7801\u5e76\u6267\u884c\u5b83\u3002<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u6280\u5de7\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>IntelliSense\uff08\u667a\u80fd\u611f\u77e5\uff09\uff1a<\/strong>VSCode \u7684 C++ \u6269\u5c55\u63d0\u4f9b IntelliSense\uff0c\u53ef\u4e3a\u60a8\u63d0\u4f9b\u4ee3\u7801\u5efa\u8bae\u548c\u81ea\u52a8\u5b8c\u6210\u3002<\/li>\n<li> <strong>\u8c03\u8bd5\uff1a<\/strong>\u60a8\u53ef\u4ee5\u4f7f\u7528 VSCode \u7684\u8c03\u8bd5\u5668\u6765\u8c03\u8bd5\u60a8\u7684 C++ \u4ee3\u7801\u3002\u5355\u51fb\u201c\u8c03\u8bd5\u201d\u89c6\u56fe\uff08\u4fa7\u8fb9\u680f\u4e2d\u7684\u866b\u5b50\u56fe\u6807\uff09\u4ee5\u5f00\u59cb\u8c03\u8bd5\u4f1a\u8bdd\u3002<\/li>\n<li> <strong>\u6269\u5c55\uff1a<\/strong>\u6709\u8bb8\u591a C++ \u6269\u5c55\u53ef\u7528\u4e8e\u589e\u5f3a\u60a8\u7684 VSCode \u4f53\u9a8c\uff0c\u4f8b\u5982\u8bed\u6cd5\u9ad8\u4eae\u3001\u4ee3\u7801\u683c\u5f0f\u5316\u548c\u4ee3\u7801\u5bfc\u822a\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662folor:#f60; text-decoration:underline;&#8217; href=&#8221;https:\/\/www.php.cn\/zt\/15742.html&#8221; target=&#8221;_blank&#8221;&gt;vscode\u600e\u4e48\u5199c++\u4ee3\u7801\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>\u901a\u8fc7 visual studio code\uff08vscode\uff09\u7f16\u5199 c++ \u4ee3\u7801\u7684\u6b65\u9aa4\uff1a\u5b89\u88c5 c++ \u6269\u5c55\uff1b\u914d\u7f6e c++ \u7f16\u8bd1\u5668\uff1b\u65b0\u5efa c++ \u9879\u76ee\u5e76\u521b\u5efa\u4e3b\u6587\u4ef6\uff1b\u7f16\u5199 c++ \u4ee3\u7801\uff1b\u7f16\u8bd1\u5e76\u8fd0\u884c\u4ee3\u7801\uff1b\u4f7f\u7528 intellisense \u548c\u8c03\u8bd5\u5668\u7b80\u5316\u7f16\u7801\u8fc7\u7a0b\u3002 \u5982\u4f55\u4f7f\u7528 Visual Studio Code \u7f16\u5199 C++ \u4ee3\u7801 \u4f7f\u7528 Visual Studio Code\uff08\u7b80\u79f0 VSCode\uff09\u7f16\u5199 C++ \u4ee3\u7801\u975e\u5e38\u7b80\u5355\u3002\u4ee5\u4e0b\u662f\u5206\u6b65\u6307\u5357\uff1a \u6b65\u9aa4 1\uff1a\u5b89\u88c5 C++ \u6269\u5c55 \u6253\u5f00 VSCode\uff0c\u7136\u540e\u5355\u51fb\u6269\u5c55\u56fe\u6807\uff08\u4fa7\u8fb9\u680f\u5de6\u4e0a\u89d2\u7684\u9f7f\u8f6e\u56fe\u6807\uff09\u3002 \u641c\u7d22\u201cC++\u201d\u3002 \u5355\u51fb\u201cC++\u201d\u6269\u5c55\u5e76\u5355\u51fb\u201c\u5b89\u88c5\u201d\u3002 \u6b65\u9aa4 2\uff1a\u914d\u7f6e C++ \u7f16\u8bd1\u5668 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u5355\u51fb\u201c\u4ee3\u7801\u201d\u83dc\u5355\uff0c\u7136\u540e\u9009\u62e9\u201c\u9996\u9009\u9879\u201d\u6216\u201c\u8bbe\u7f6e\u201d\u3002 \u641c\u7d22\u201cC_Cpp.default.compilerPath\u201d\uff0c\u7136\u540e\u9009\u62e9\u60a8\u8981\u4f7f\u7528\u7684\u7f16\u8bd1\u5668\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e MinGW\uff0c\u8bf7\u9009\u62e9\u201cC:\/mingw64\/bin\/g++.exe\u201d\u3002 \u6b65\u9aa4 3\uff1a\u65b0\u5efa C++ \u9879\u76ee \u5355\u51fb\u201c\u6587\u4ef6\u201d\u83dc\u5355\uff0c\u7136\u540e\u9009\u62e9\u201c\u65b0\u5efa\u201d&gt;\u201c\u6587\u4ef6\u5939\u201d\u3002 \u4e3a\u60a8\u7684\u9879\u76ee\u547d\u540d\u5e76\u5355\u51fb\u201c\u521b\u5efa\u201d\u3002 \u6b65\u9aa4 4\uff1a\u521b\u5efa C++ [&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-18708","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18708","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=18708"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18708\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}