{"id":20621,"date":"2024-11-19T11:11:27","date_gmt":"2024-11-19T03:11:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20621\/"},"modified":"2024-11-19T11:11:27","modified_gmt":"2024-11-19T03:11:27","slug":"sublime%e6%80%8e%e4%b9%88%e7%bc%96%e8%af%91cpp","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20621\/","title":{"rendered":"sublime\u600e\u4e48\u7f16\u8bd1cpp"},"content":{"rendered":"<blockquote><p>\n  \u53ef\u4ee5\u4f7f\u7528 sublime text \u7f16\u8bd1 c++ \u4ee3\u7801\uff1a\u5b89\u88c5 mingw \u6216 clang \u7f16\u8bd1\u5668\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u7cfb\u7edf\u8def\u5f84\u3002\u5728 sublime text \u7684\u8bbe\u7f6e\u4e2d\u6dfb\u52a0\u6784\u5efa\u7cfb\u7edf\u914d\u7f6e\uff0c\u6307\u5b9a\u7f16\u8bd1\u5668\u548c\u5176\u4ed6\u53c2\u6570\u3002\u4fdd\u5b58\u8bbe\u7f6e\uff0c\u7136\u540e\u6309\u5feb\u6377\u952e\u7f16\u8bd1\u4ee3\u7801\u3002\u7f16\u8bd1\u540e\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5c06\u4fdd\u5b58\u5728\u6e90\u4ee3\u7801\u6587\u4ef6\u76ee\u5f55\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u547d\u4ee4\u8fd0\u884c\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/03\/2024040308572110964.jpg\" class=\"aligncenter\" title=\"sublime\u600e\u4e48\u7f16\u8bd1cpp\u63d2\u56fe\" alt=\"sublime\u600e\u4e48\u7f16\u8bd1cpp\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 Sublime \u6587\u672c\u7f16\u8f91\u5668\u7f16\u8bd1 C++ \u4ee3\u7801<\/strong><\/p>\n<p>Sublime Text \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ec C++\u3002\u8981\u4f7f\u7528\u5b83\u7f16\u8bd1 C++ \u4ee3\u7801\uff0c\u9700\u8981\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5\u7f16\u8bd1\u5668<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u4e00\u4e2a C++ \u7f16\u8bd1\u5668\uff0c\u4f8b\u5982 MinGW \u6216 Clang\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u786e\u4fdd\u5c06\u5176\u6dfb\u52a0\u5230\u7cfb\u7edf\u8def\u5f84\u4e2d\u3002<\/p>\n<p><strong>2. \u8bbe\u7f6e Sublime Text<\/strong><\/p>\n<p>\u6253\u5f00 Sublime Text\uff0c\u6309 Ctrl+Shift+P\uff08Windows\uff09\u6216 Cmd+Shift+P\uff08macOS\uff09\u6253\u5f00\u547d\u4ee4\u9762\u677f\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>Preferences: Open Settings (User)<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u6253\u5f00\u7684\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>\"build_systems\": [\n    {\n        \"name\": \"C++ (g++)\",\n        \"build_path\": \"${file_path}\",\n        \"working_dir\": \"${file_path}\",\n        \"compiler\": \"g++\",\n        \"args\": [\"${file_basename_without_extension}.cpp\"]\n    }\n]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06 compiler \u66ff\u6362\u4e3a\u5df2\u5b89\u88c5\u7684\u7f16\u8bd1\u5668\u8def\u5f84\u3002<\/p>\n<p><strong>3. \u4fdd\u5b58\u5e76\u7f16\u8bd1<\/strong><\/p>\n<p>\u4fdd\u5b58\u8bbe\u7f6e\u6587\u4ef6\u3002\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7 Ctrl+B\uff08Windows\uff09\u6216 Cmd+B\uff08macOS\uff09\u5728 Sublime Text \u4e2d\u7f16\u8bd1 C++ \u4ee3\u7801\u3002<\/p>\n<p><strong>4. \u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6<\/strong><\/p>\n<p>\u7f16\u8bd1\u540e\uff0c\u53ef\u6267\u884c\u6587\u4ef6\u5c06\u4fdd\u5b58\u5728\u4e0e\u6e90\u4ee3\u7801\u6587\u4ef6\u76f8\u540c\u7684\u76ee\u5f55\u4e2d\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u5b83\uff1a<\/p>\n<pre>.\/${file_basename_without_extension}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>Sublime Text \u8fd8\u4f1a\u81ea\u52a8\u5b8c\u6210\u4ee3\u7801\u5e76\u63d0\u4f9b\u8bed\u6cd5\u9ad8\u4eae\u3002<\/li>\n<li>\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u63d2\u4ef6\u6765\u589e\u5f3a C++ \u5f00\u53d1\u4f53\u9a8c\uff0c\u4f8b\u5982\u4ee3\u7801\u7247\u6bb5\u7ba1\u7406\u5668\u548c\u8c03\u8bd5\u5de5\u5177\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u7f16\u8bd1cpp\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>\u53ef\u4ee5\u4f7f\u7528 sublime text \u7f16\u8bd1 c++ \u4ee3\u7801\uff1a\u5b89\u88c5 mingw \u6216 clang \u7f16\u8bd1\u5668\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u7cfb\u7edf\u8def\u5f84\u3002\u5728 sublime text \u7684\u8bbe\u7f6e\u4e2d\u6dfb\u52a0\u6784\u5efa\u7cfb\u7edf\u914d\u7f6e\uff0c\u6307\u5b9a\u7f16\u8bd1\u5668\u548c\u5176\u4ed6\u53c2\u6570\u3002\u4fdd\u5b58\u8bbe\u7f6e\uff0c\u7136\u540e\u6309\u5feb\u6377\u952e\u7f16\u8bd1\u4ee3\u7801\u3002\u7f16\u8bd1\u540e\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5c06\u4fdd\u5b58\u5728\u6e90\u4ee3\u7801\u6587\u4ef6\u76ee\u5f55\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u547d\u4ee4\u8fd0\u884c\u3002 \u5982\u4f55\u4f7f\u7528 Sublime \u6587\u672c\u7f16\u8f91\u5668\u7f16\u8bd1 C++ \u4ee3\u7801 Sublime Text \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ec C++\u3002\u8981\u4f7f\u7528\u5b83\u7f16\u8bd1 C++ \u4ee3\u7801\uff0c\u9700\u8981\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u5b89\u88c5\u7f16\u8bd1\u5668 \u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u4e00\u4e2a C++ \u7f16\u8bd1\u5668\uff0c\u4f8b\u5982 MinGW \u6216 Clang\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u786e\u4fdd\u5c06\u5176\u6dfb\u52a0\u5230\u7cfb\u7edf\u8def\u5f84\u4e2d\u3002 2. \u8bbe\u7f6e Sublime Text \u6253\u5f00 Sublime Text\uff0c\u6309 Ctrl+Shift+P\uff08Windows\uff09\u6216 Cmd+Shift+P\uff08macOS\uff09\u6253\u5f00\u547d\u4ee4\u9762\u677f\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a Preferences: Open Settings (User) \u767b\u5f55\u540e\u590d\u5236 \u5728\u6253\u5f00\u7684\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a &#8220;build_systems&#8221;: [ { &#8220;name&#8221;: &#8220;C++ (g++)&#8221;, &#8220;build_path&#8221;: &#8220;${file_path}&#8221;, [&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-20621","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20621","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=20621"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20621\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}