{"id":47687,"date":"2025-07-30T08:47:11","date_gmt":"2025-07-30T00:47:11","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/47687.html"},"modified":"2025-07-30T08:47:11","modified_gmt":"2025-07-30T00:47:11","slug":"%e5%9c%a8wsl%e4%b8%ad%e9%85%8d%e7%bd%aevs-code-c%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%ae%8c%e6%95%b4%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/47687.html","title":{"rendered":"\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b"},"content":{"rendered":"<p>\u5728Windows\u7cfb\u7edf\u4e0a\u8fdb\u884cC&#043;&#043;\u5f00\u53d1\u65f6&#xff0c;\u501f\u52a9Windows Subsystem for Linux (WSL)\u53ef\u4ee5\u83b7\u5f97\u63a5\u8fd1\u539f\u751fLinux\u7684\u5f00\u53d1\u4f53\u9a8c\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728WSL\u73af\u5883\u4e2d\u914d\u7f6eVS Code&#xff0c;\u642d\u5efa\u9ad8\u6548\u7684C&#043;&#043;\u5f00\u53d1\u73af\u5883&#xff0c;\u5305\u62ec\u7f16\u8bd1\u5668\u5b89\u88c5\u3001\u9879\u76ee\u521b\u5efa\u3001\u4ee3\u7801\u7f16\u5199\u3001\u8c03\u8bd5\u914d\u7f6e\u7b49\u5168\u8fc7\u7a0b\u3002<\/p>\n<h3>\u73af\u5883\u51c6\u5907<\/h3>\n<h4>\u524d\u7f6e\u8981\u6c42<\/h4>\n<p>\u5728\u5f00\u59cb\u524d&#xff0c;\u8bf7\u786e\u4fdd\u5df2\u5b89\u88c5\u4ee5\u4e0b\u8f6f\u4ef6&#xff1a;<\/p>\n<ul>\n<li>Visual Studio Code<\/li>\n<li>VS Code\u7684WSL\u6269\u5c55<\/li>\n<li>Windows Subsystem for Linux (WSL)\u53ca\u6240\u9009Linux\u53d1\u884c\u7248&#xff08;\u672c\u6587\u4ee5Ubuntu\u4e3a\u4f8b&#xff09;<\/li>\n<\/ul>\n<h4>\u8bbe\u7f6eLinux\u5f00\u53d1\u73af\u5883<\/h4>\n<li>\u542f\u52a8WSL\u7ec8\u7aef&#xff1a;\u5728Windows\u641c\u7d22\u680f\u8f93\u5165&#034;Ubuntu&#034;\u5e76\u6253\u5f00<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004702-68896b8657760.png\" alt=\"Ubuntu in Start Menu\" \/><\/p>\n<li>\n<p>\u9996\u6b21\u542f\u52a8\u4f1a\u8981\u6c42\u8bbe\u7f6e\u7528\u6237\u540d\u548c\u5bc6\u7801&#xff0c;\u8bf7\u8bb0\u4f4f\u6b64\u5bc6\u7801&#xff0c;\u540e\u7eed\u4f7f\u7528sudo\u547d\u4ee4\u65f6\u9700\u8981<\/p>\n<\/li>\n<li>\n<p>\u66f4\u65b0\u7cfb\u7edf\u5305\u5217\u8868\u5e76\u5b89\u88c5GNU\u7f16\u8bd1\u5668\u5de5\u5177\u548cGDB\u8c03\u8bd5\u5668&#xff1a;<\/p>\n<\/li>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> update<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> build-essential gdb<\/p>\n<li>\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f&#xff1a;<\/li>\n<p><span class=\"token function\">whereis<\/span> g&#043;&#043;<br \/>\n<span class=\"token function\">whereis<\/span> gdb<\/p>\n<p>\u5982\u679c\u5b89\u88c5\u6210\u529f&#xff0c;\u4f1a\u663e\u793ag&#043;&#043;\u548cgdb\u7684\u8def\u5f84\u4fe1\u606f\u3002<\/p>\n<li>\u521b\u5efa\u9879\u76ee\u76ee\u5f55&#xff1a;<\/li>\n<p><span class=\"token function\">mkdir<\/span> projects<br \/>\n<span class=\"token builtin class-name\">cd<\/span> projects<br \/>\n<span class=\"token function\">mkdir<\/span> helloworld<br \/>\n<span class=\"token builtin class-name\">cd<\/span> helloworld<\/p>\n<h3>\u5728WSL\u4e2d\u542f\u52a8VS Code<\/h3>\n<p>\u5728WSL\u7ec8\u7aef\u4e2d&#xff0c;\u8fdb\u5165\u9879\u76ee\u76ee\u5f55\u5e76\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8VS Code&#xff1a;<\/p>\n<p>code <span class=\"token builtin class-name\">.<\/span><\/p>\n<p>\u9996\u6b21\u542f\u52a8\u65f6&#xff0c;VS Code\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5WSL\u670d\u52a1\u5668\u7ec4\u4ef6\u3002\u6210\u529f\u542f\u52a8\u540e&#xff0c;VS Code\u7a97\u53e3\u6807\u9898\u680f\u4f1a\u663e\u793a&#034;WSL: Ubuntu&#034;&#xff0c;\u72b6\u6001\u680f\u4f1a\u663e\u793a\u8fdc\u7a0b\u8fde\u63a5\u72b6\u6001\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004702-68896b86e7b91.png\" alt=\"Remote context in the Status bar\" \/><\/p>\n<h3>\u5b89\u88c5C\/C&#043;&#043;\u6269\u5c55<\/h3>\n<li>\u5728VS Code\u4e2d\u6253\u5f00\u6269\u5c55\u9762\u677f&#xff08;Ctrl&#043;Shift&#043;X&#xff09;<\/li>\n<li>\u641c\u7d22&#034;C\/C&#043;&#043;&#034;\u6269\u5c55&#xff08;\u7531Microsoft\u63d0\u4f9b&#xff09;<\/li>\n<li>\u5982\u679c\u5df2\u5728\u672c\u5730\u5b89\u88c5&#xff0c;\u70b9\u51fb&#034;Install in WSL&#034;\u6309\u94ae\u5c06\u5176\u5b89\u88c5\u5230WSL\u73af\u5883\u4e2d<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004703-68896b87533ae.png\" alt=\"Install in WSL button\" \/><\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u9700\u8981\u91cd\u65b0\u52a0\u8f7dVS Code\u4ee5\u751f\u6548\u3002<\/p>\n<h3>\u521b\u5efa\u548c\u7f16\u5199C&#043;&#043;\u4ee3\u7801<\/h3>\n<li>\u5728VS Code\u6587\u4ef6\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d&#xff0c;\u70b9\u51fb&#034;\u65b0\u5efa\u6587\u4ef6&#034;\u6309\u94ae&#xff0c;\u521b\u5efahelloworld.cpp<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004704-68896b883ca78.png\" alt=\"New File title bar button\" \/><\/p>\n<li>\u7c98\u8d34\u4ee5\u4e0b\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/li>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;iostream&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;vector&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;string&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">using<\/span> <span class=\"token keyword\">namespace<\/span> std<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    vector<span class=\"token operator\">&lt;<\/span>string<span class=\"token operator\">&gt;<\/span> msg <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;Hello&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;C&#043;&#043;&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;World&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;from&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;VS Code&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;and the C&#043;&#043; extension!&#034;<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> string<span class=\"token operator\">&amp;<\/span> word <span class=\"token operator\">:<\/span> msg<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        cout <span class=\"token operator\">&lt;&lt;<\/span> word <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">&#034; &#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    cout <span class=\"token operator\">&lt;&lt;<\/span> endl<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<li>\u4fdd\u5b58\u6587\u4ef6&#xff08;Ctrl&#043;S&#xff09;<\/li>\n<h3>\u63a2\u7d22IntelliSense\u529f\u80fd<\/h3>\n<p>VS Code\u7684C\/C&#043;&#043;\u6269\u5c55\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684IntelliSense\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u60ac\u505c\u5728vector\u6216string\u4e0a\u67e5\u770b\u7c7b\u578b\u4fe1\u606f<\/li>\n<li>\u8f93\u5165msg.\u65f6\u4f1a\u81ea\u52a8\u663e\u793a\u6210\u5458\u51fd\u6570\u5217\u8868<\/li>\n<li>\u81ea\u52a8\u8865\u5168\u529f\u80fd\u53ef\u901a\u8fc7Tab\u952e\u89e6\u53d1<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004704-68896b88d1cd5.png\" alt=\"Statement completion IntelliSense\" \/><\/p>\n<h3>\u8fd0\u884cC&#043;&#043;\u7a0b\u5e8f<\/h3>\n<li>\u786e\u4fddhelloworld.cpp\u662f\u5f53\u524d\u6d3b\u52a8\u6587\u4ef6<\/li>\n<li>\u70b9\u51fb\u7f16\u8f91\u5668\u53f3\u4e0a\u89d2\u7684&#034;\u64ad\u653e&#034;\u6309\u94ae<\/li>\n<li>\u5728\u5f39\u51fa\u7684\u7f16\u8bd1\u5668\u9009\u62e9\u4e2d&#xff0c;\u9009\u62e9&#034;g&#043;&#043; build and debug active file&#034;<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004707-68896b8ba7905.png\" alt=\"C&#043;&#043; debug configuration dropdown\" \/><\/p>\n<p>VS Code\u4f1a\u81ea\u52a8\u751f\u6210tasks.json\u6587\u4ef6&#xff0c;\u7528\u4e8e\u914d\u7f6e\u6784\u5efa\u4efb\u52a1\u3002\u6210\u529f\u8fd0\u884c\u540e&#xff0c;\u5728\u96c6\u6210\u7ec8\u7aef\u4e2d\u4f1a\u770b\u5230\u8f93\u51fa&#xff1a;<\/p>\n<p>Hello C&#043;&#043; World from VS Code and the C&#043;&#043; extension!<\/p>\n<h4>\u7406\u89e3tasks.json<\/h4>\n<p>\u81ea\u52a8\u751f\u6210\u7684tasks.json\u4f4d\u4e8e.vscode\u76ee\u5f55\u4e0b&#xff0c;\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string\">&#034;version&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;2.0.0&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string\">&#034;tasks&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token string\">&#034;type&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;shell&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;label&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;C\/C&#043;&#043;: g&#043;&#043; build active file&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;command&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\/usr\/bin\/g&#043;&#043;&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;args&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;-g&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;${file}&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;-o&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;${fileDirname}\/${fileBasenameNoExtension}&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;options&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#034;cwd&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\/usr\/bin&#034;<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;problemMatcher&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;$gcc&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;group&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#034;kind&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;build&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;isDefault&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;detail&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;Task generated by Debugger.&#034;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5173\u952e\u53c2\u6570\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>command: \u6307\u5b9a\u7f16\u8bd1\u5668\u8def\u5f84&#xff08;g&#043;&#043;&#xff09;<\/li>\n<li>args: \u7f16\u8bd1\u53c2\u6570&#xff0c;-g\u8868\u793a\u751f\u6210\u8c03\u8bd5\u4fe1\u606f<\/li>\n<li>${file}: \u5f53\u524d\u6d3b\u52a8\u6587\u4ef6<\/li>\n<li>${fileDirname}\/${fileBasenameNoExtension}: \u8f93\u51fa\u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u548c\u540d\u79f0<\/li>\n<\/ul>\n<h3>\u8c03\u8bd5C&#043;&#043;\u7a0b\u5e8f<\/h3>\n<li>\u5728\u4ee3\u7801\u884c\u53f7\u65c1\u70b9\u51fb\u8bbe\u7f6e\u65ad\u70b9&#xff08;\u6216\u6309F9&#xff09;<\/li>\n<li>\u4ece\u64ad\u653e\u6309\u94ae\u4e0b\u62c9\u83dc\u5355\u4e2d\u9009\u62e9&#034;Debug C\/C&#043;&#043; File&#034;<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004708-68896b8c398a2.png\" alt=\"screenshot of breakpoint in helloworld.cpp\" \/><\/p>\n<p>\u8c03\u8bd5\u63a7\u5236\u9762\u677f\u63d0\u4f9b\u4e86\u5e38\u7528\u8c03\u8bd5\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u7ee7\u7eed&#xff08;F5&#xff09;<\/li>\n<li>\u5355\u6b65\u8df3\u8fc7&#xff08;F10&#xff09;<\/li>\n<li>\u5355\u6b65\u8fdb\u5165&#xff08;F11&#xff09;<\/li>\n<li>\u5355\u6b65\u9000\u51fa&#xff08;Shift&#043;F11&#xff09;<\/li>\n<li>\u91cd\u542f&#xff08;Ctrl&#043;Shift&#043;F5&#xff09;<\/li>\n<li>\u505c\u6b62&#xff08;Shift&#043;F5&#xff09;<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004710-68896b8eb60ce.png\" alt=\"Debugging controls\" \/><\/p>\n<p>\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d&#xff0c;\u53ef\u4ee5\u901a\u8fc7&#034;\u53d8\u91cf&#034;\u7a97\u53e3\u67e5\u770b\u5f53\u524d\u53d8\u91cf\u503c&#xff0c;\u901a\u8fc7&#034;\u76d1\u89c6&#034;\u7a97\u53e3\u6dfb\u52a0\u81ea\u5b9a\u4e49\u76d1\u89c6\u8868\u8fbe\u5f0f\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004710-68896b8ebf310.png\" alt=\"Debugging windows\" \/><\/p>\n<h4>\u81ea\u5b9a\u4e49\u8c03\u8bd5\u914d\u7f6e<\/h4>\n<p>\u5982\u9700\u81ea\u5b9a\u4e49\u8c03\u8bd5\u8bbe\u7f6e&#xff0c;\u53ef\u4ee5\u521b\u5efalaunch.json\u6587\u4ef6&#xff1a;<\/p>\n<li>\u6253\u5f00&#034;\u8fd0\u884c\u548c\u8c03\u8bd5&#034;\u9762\u677f&#xff08;Ctrl&#043;Shift&#043;D&#xff09;<\/li>\n<li>\u70b9\u51fb&#034;\u521b\u5efalaunch.json\u6587\u4ef6&#034;<\/li>\n<li>\u9009\u62e9&#034;C&#043;&#043; (GDB\/LLDB)&#034;\u73af\u5883<\/li>\n<li>\u9009\u62e9&#034;g&#043;&#043; build and debug active file&#034;\u914d\u7f6e<\/li>\n<p>\u751f\u6210\u7684launch.json\u6587\u4ef6\u5982\u4e0b&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string\">&#034;version&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;0.2.0&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string\">&#034;configurations&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token string\">&#034;name&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;C\/C&#043;&#043;: g&#043;&#043; build and debug active file&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;type&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;cppdbg&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;request&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;launch&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;program&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;${fileDirname}\/${fileBasenameNoExtension}&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;args&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;stopAtEntry&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;cwd&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;${workspaceFolder}&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;environment&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;externalConsole&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;MIMode&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;gdb&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;miDebuggerPath&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\/usr\/bin\/gdb&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;setupCommands&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n          <span class=\"token string\">&#034;description&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;Enable pretty-printing for gdb&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n          <span class=\"token string\">&#034;text&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;-enable-pretty-printing&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n          <span class=\"token string\">&#034;ignoreFailures&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;preLaunchTask&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;C\/C&#043;&#043;: g&#043;&#043; build active file&#034;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5173\u952e\u914d\u7f6e\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>program: \u6307\u5b9a\u8981\u8c03\u8bd5\u7684\u53ef\u6267\u884c\u6587\u4ef6<\/li>\n<li>args: \u4f20\u9012\u7ed9\u7a0b\u5e8f\u7684\u547d\u4ee4\u884c\u53c2\u6570<\/li>\n<li>stopAtEntry: \u8bbe\u7f6e\u4e3atrue\u53ef\u5728main\u51fd\u6570\u5165\u53e3\u5904\u6682\u505c<\/li>\n<li>preLaunchTask: \u6307\u5b9a\u8c03\u8bd5\u524d\u6267\u884c\u7684\u6784\u5efa\u4efb\u52a1<\/li>\n<\/ul>\n<h3>\u9ad8\u7ea7\u914d\u7f6e&#xff1a;c_cpp_properties.json<\/h3>\n<p>\u5982\u9700\u81ea\u5b9a\u4e49C\/C&#043;&#043;\u6269\u5c55\u914d\u7f6e&#xff08;\u5982\u7f16\u8bd1\u5668\u8def\u5f84\u3001\u5305\u542b\u8def\u5f84\u3001C&#043;&#043;\u6807\u51c6\u7b49&#xff09;&#xff1a;<\/p>\n<li>\u6253\u5f00\u547d\u4ee4\u9762\u677f&#xff08;Ctrl&#043;Shift&#043;P&#xff09;<\/li>\n<li>\u8fd0\u884c&#034;C\/C&#043;&#043;: Edit Configurations (UI)&#034;\u547d\u4ee4<\/li>\n<li>\u5728\u914d\u7f6e\u754c\u9762\u4e2d\u4fee\u6539\u8bbe\u7f6e&#xff0c;VS Code\u4f1a\u81ea\u52a8\u751f\u6210c_cpp_properties.json\u6587\u4ef6<\/li>\n<p>\u5178\u578b\u7684\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string\">&#034;configurations&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token string\">&#034;name&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;Linux&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;includePath&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;${workspaceFolder}\/**&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;defines&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;compilerPath&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\/usr\/bin\/gcc&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;cStandard&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;c11&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;cppStandard&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;c&#043;&#043;17&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string\">&#034;intelliSenseMode&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;clang-x64&#034;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string\">&#034;version&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">4<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<h4>1. \u7f16\u8bd1\u5668\u672a\u627e\u5230<\/h4>\n<p>\u95ee\u9898&#xff1a;\u63d0\u793a&#034;g&#043;&#043;: command not found&#034;<br \/>\n\u89e3\u51b3&#xff1a;\u786e\u4fdd\u5df2\u5b89\u88c5build-essential\u5305&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> build-essential<\/p>\n<h4>2. \u8c03\u8bd5\u5668\u65e0\u6cd5\u542f\u52a8<\/h4>\n<p>\u95ee\u9898&#xff1a;\u8c03\u8bd5\u65f6\u63d0\u793a&#034;miDebuggerPath&#034;\u914d\u7f6e\u9519\u8bef<br \/>\n\u89e3\u51b3&#xff1a;\u68c0\u67e5gdb\u662f\u5426\u5b89\u88c5&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> gdb<br \/>\n<span class=\"token function\">whereis<\/span> gdb  <span class=\"token comment\"># \u786e\u8ba4\u8def\u5f84<\/span><\/p>\n<p>\u66f4\u65b0launch.json\u4e2d\u7684miDebuggerPath\u4e3a\u6b63\u786e\u8def\u5f84\u3002<\/p>\n<h4>3. IntelliSense\u4e0d\u5de5\u4f5c<\/h4>\n<p>\u95ee\u9898&#xff1a;\u4ee3\u7801\u63d0\u793a\u548c\u81ea\u52a8\u8865\u5168\u529f\u80fd\u5931\u6548<br \/>\n\u89e3\u51b3&#xff1a;<\/p>\n<li>\u786e\u4fddC\/C&#043;&#043;\u6269\u5c55\u5df2\u6b63\u786e\u5b89\u88c5\u5728WSL\u4e2d<\/li>\n<li>\u68c0\u67e5c_cpp_properties.json\u4e2d\u7684\u7f16\u8bd1\u5668\u8def\u5f84\u662f\u5426\u6b63\u786e<\/li>\n<li>\u91cd\u542fVS Code<\/li>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u901a\u8fc7\u672c\u6587\u6559\u7a0b&#xff0c;\u4f60\u5df2\u7ecf\u5b66\u4f1a\u4e86\u5982\u4f55\u5728WSL\u73af\u5883\u4e2d\u914d\u7f6eVS Code\u8fdb\u884cC&#043;&#043;\u5f00\u53d1&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u8bbe\u7f6eWSL\u548cLinux\u5f00\u53d1\u73af\u5883<\/li>\n<li>\u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177\u548c\u6269\u5c55<\/li>\n<li>\u521b\u5efa\u3001\u7f16\u8bd1\u3001\u8fd0\u884c\u548c\u8c03\u8bd5C&#043;&#043;\u7a0b\u5e8f<\/li>\n<li>\u914d\u7f6e\u81ea\u5b9a\u4e49\u6784\u5efa\u548c\u8c03\u8bd5\u4efb\u52a1<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u5f00\u53d1\u65b9\u5f0f\u7ed3\u5408\u4e86Windows\u7684\u6613\u7528\u6027\u548cLinux\u7684\u5f00\u53d1\u73af\u5883\u4f18\u52bf&#xff0c;\u7279\u522b\u9002\u5408\u9700\u8981\u8de8\u5e73\u53f0\u5f00\u53d1\u7684C&#043;&#043;\u9879\u76ee\u3002<\/p>\n<h3>\u540e\u7eed\u5b66\u4e60<\/h3>\n<ul>\n<li>\u63a2\u7d22VS Code\u66f4\u591a\u529f\u80fd&#xff1a;\u4ee3\u7801\u7247\u6bb5\u3001Git\u96c6\u6210\u3001\u4efb\u52a1\u81ea\u52a8\u5316<\/li>\n<li>\u5b66\u4e60CMake\u6784\u5efa\u7cfb\u7edf&#xff0c;\u7ba1\u7406\u590d\u6742\u9879\u76ee<\/li>\n<li>\u5c1d\u8bd5\u4f7f\u7528Docker\u5bb9\u5668\u5316\u5f00\u53d1\u73af\u5883<\/li>\n<li>\u6df1\u5165\u5b66\u4e60C&#043;&#043;\u8bed\u8a00\u7279\u6027\u548c\u6807\u51c6\u5e93<\/li>\n<\/ul>\n<p>\u795d\u4f60\u5728WSL&#043;VS Code\u7684\u5f00\u53d1\u4e4b\u8def\u4e0a\u8d8a\u8d70\u8d8a\u8fdc&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb428\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u5982\u9700\u81ea\u5b9a\u4e49\u8c03\u8bd5\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u521b\u5efa\u6253\u5f00&quot;\u8fd0\u884c\u548c\u8c03\u8bd5&quot;\u9762\u677f\uff08Ctrl+Shift+D\uff09\u70b9\u51fb&quot;\u521b\u5efalaunch.json\u6587\u4ef6&quot;\u9009\u62e9&quot;C++ (GDB\/LLDB)&quot;\u73af\u5883\u9009\u62e9&quot;g++ build and debug active file&quot;\u914d\u7f6e\u751f\u6210\u7684],program: \u6307\u5b9a\u8981\u8c03\u8bd5\u7684\u53ef\u6267\u884c\u6587\u4ef6args: \u4f20\u9012\u7ed9\u7a0b\u5e8f\u7684\u547d\u4ee4\u884c\u53c2\u6570: \u8bbe\u7f6e\u4e3atrue\u53ef\u5728main\u51fd\u6570\u5165\u53e3\u5904\u6682\u505c: \u6307\u5b9a\u8c03\u8bd5\u524d\u6267\u884c\u7684\u6784\u5efa\u4efb\u52a1\u8bbe\u7f6eWSL\u548cLinux\u5f00\u53d1\u73af\u5883\u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177\u548c\u6269\u5c55\u521b\u5efa\u3001\u7f16\u8bd1\u3001\u8fd0\u884c\u548c\u8c03\u8bd5C++\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"author":2,"featured_media":47678,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,190,4583],"topic":[],"class_list":["post-47687","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-190","tag-4583"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/47687.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb428\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u5982\u9700\u81ea\u5b9a\u4e49\u8c03\u8bd5\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u521b\u5efa\u6253\u5f00&quot;\u8fd0\u884c\u548c\u8c03\u8bd5&quot;\u9762\u677f\uff08Ctrl+Shift+D\uff09\u70b9\u51fb&quot;\u521b\u5efalaunch.json\u6587\u4ef6&quot;\u9009\u62e9&quot;C++ (GDB\/LLDB)&quot;\u73af\u5883\u9009\u62e9&quot;g++ build and debug active file&quot;\u914d\u7f6e\u751f\u6210\u7684],program: \u6307\u5b9a\u8981\u8c03\u8bd5\u7684\u53ef\u6267\u884c\u6587\u4ef6args: \u4f20\u9012\u7ed9\u7a0b\u5e8f\u7684\u547d\u4ee4\u884c\u53c2\u6570: \u8bbe\u7f6e\u4e3atrue\u53ef\u5728main\u51fd\u6570\u5165\u53e3\u5904\u6682\u505c: \u6307\u5b9a\u8c03\u8bd5\u524d\u6267\u884c\u7684\u6784\u5efa\u4efb\u52a1\u8bbe\u7f6eWSL\u548cLinux\u5f00\u53d1\u73af\u5883\u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177\u548c\u6269\u5c55\u521b\u5efa\u3001\u7f16\u8bd1\u3001\u8fd0\u884c\u548c\u8c03\u8bd5C++\u7a0b\u5e8f\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/47687.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T00:47:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004702-68896b8657760.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/47687.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/47687.html\",\"name\":\"\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T00:47:11+00:00\",\"dateModified\":\"2025-07-30T00:47:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/47687.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/47687.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/47687.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/47687.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb428\u6b21\uff0c\u70b9\u8d5e12\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u5982\u9700\u81ea\u5b9a\u4e49\u8c03\u8bd5\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u521b\u5efa\u6253\u5f00&quot;\u8fd0\u884c\u548c\u8c03\u8bd5&quot;\u9762\u677f\uff08Ctrl+Shift+D\uff09\u70b9\u51fb&quot;\u521b\u5efalaunch.json\u6587\u4ef6&quot;\u9009\u62e9&quot;C++ (GDB\/LLDB)&quot;\u73af\u5883\u9009\u62e9&quot;g++ build and debug active file&quot;\u914d\u7f6e\u751f\u6210\u7684],program: \u6307\u5b9a\u8981\u8c03\u8bd5\u7684\u53ef\u6267\u884c\u6587\u4ef6args: \u4f20\u9012\u7ed9\u7a0b\u5e8f\u7684\u547d\u4ee4\u884c\u53c2\u6570: \u8bbe\u7f6e\u4e3atrue\u53ef\u5728main\u51fd\u6570\u5165\u53e3\u5904\u6682\u505c: \u6307\u5b9a\u8c03\u8bd5\u524d\u6267\u884c\u7684\u6784\u5efa\u4efb\u52a1\u8bbe\u7f6eWSL\u548cLinux\u5f00\u53d1\u73af\u5883\u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177\u548c\u6269\u5c55\u521b\u5efa\u3001\u7f16\u8bd1\u3001\u8fd0\u884c\u548c\u8c03\u8bd5C++\u7a0b\u5e8f\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/47687.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T00:47:11+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730004702-68896b8657760.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/47687.html","url":"https:\/\/www.wsisp.com\/helps\/47687.html","name":"\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T00:47:11+00:00","dateModified":"2025-07-30T00:47:11+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/47687.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/47687.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/47687.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5728WSL\u4e2d\u914d\u7f6eVS Code C++\u5f00\u53d1\u73af\u5883\u5b8c\u6574\u6559\u7a0b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/47687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=47687"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/47687\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/47678"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=47687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=47687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=47687"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=47687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}