{"id":17294,"date":"2025-04-18T23:42:45","date_gmt":"2025-04-18T15:42:45","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/17294.html"},"modified":"2025-04-18T23:42:45","modified_gmt":"2025-04-18T15:42:45","slug":"%e5%9c%a8windows%e5%ad%90%e7%b3%bb%e7%bb%9fwsl%ef%bc%88linux%ef%bc%89%e4%b8%ad%e7%94%a8c%e6%90%ad%e5%bb%ba%e7%ae%80%e5%8d%95%e8%81%8a%e5%a4%a9%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/17294.html","title":{"rendered":"\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668"},"content":{"rendered":"<h2>Tiny Bridge \u2014 Chat Pool<\/h2>\n<h2>\u5728Windows\u5b50\u7cfb\u7edfWSL&#xff08;Linux&#xff09;\u4e2d\u7528C&#043;&#043;\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668<\/h2>\n<p>\u4ed3\u5e93\u5730\u5740&#xff1a;https:\/\/github.com\/Leo072060\/Chat-Pool<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418154240-680272f09b144.jpg\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>\u9879\u76ee\u7b80\u4ecb<\/h2>\n<p>\u652f\u6301\u591a\u7528\u6237\u5728\u7ebf\u5b9e\u65f6\u804a\u5929&#xff0c;\u6d88\u606f\u901a\u8fc7\u670d\u52a1\u5668\u9ad8\u6548\u8f6c\u53d1&#xff0c;\u786e\u4fdd\u6240\u6709\u7528\u6237\u540c\u6b65\u63a5\u6536\u6700\u65b0\u804a\u5929\u5185\u5bb9\u3002<\/p>\n<p>HTTP\u670d\u52a1\u5668 \u91c7\u7528C&#043;&#043;\u5b9e\u73b0&#xff0c;\u652f\u6301\u5904\u7406\u5e38\u89c1\u7684HTTP\u8bf7\u6c42&#xff08;\u5982GET\u3001POST&#xff09;&#xff0c;\u80fd\u591f\u89e3\u6790\u6d4f\u89c8\u5668\u8bf7\u6c42\u5e76\u751f\u6210\u5bf9\u5e94\u7684HTTP\u54cd\u5e94&#xff0c;\u786e\u4fdd\u4e0e\u5ba2\u6237\u7aef\u7684\u9ad8\u6548\u4ea4\u4e92\u3002 \u5b9e\u73b0\u65e5\u5fd7\u7684\u5199\u5165&#xff0c;\u65b9\u4fbfHTTP\u670d\u52a1\u5668\u8c03\u8bd5\u3002<\/p>\n<p>\u8fdb\u7a0b\u95f4\u901a\u4fe1 \u901a\u8fc7\u8fdb\u7a0b\u5957\u63a5\u5b57&#xff08;IPC Socket&#xff09;\u5b9e\u73b0\u670d\u52a1\u5668\u4e0e\u4e8b\u52a1\u5904\u7406\u6a21\u5757\u4e4b\u95f4\u7684\u9ad8\u6548\u901a\u4fe1&#xff0c;\u786e\u4fdd\u6570\u636e\u4f20\u9012\u7684\u53ef\u9760\u6027\u4e0e\u5b9e\u65f6\u6027\u3002<\/p>\n<p>\u524d\u7aef\u9875\u9762 \u63d0\u4f9b\u7b80\u6613\u7684\u804a\u5929\u9875\u9762&#xff0c;\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u5e76\u53c2\u4e0e\u804a\u5929\u3002<\/p>\n<p>\u7f51\u7edc \u901a\u8fc7\u914d\u7f6eWSL\u955c\u50cf\u7f51\u7edc&#xff0c;\u5e76\u7ed3\u5408\u5185\u7f51\u7a7f\u900f\u6280\u672f&#xff0c;\u5b9e\u73b0\u5916\u7f51\u5bf9\u672c\u5730\u670d\u52a1\u7684\u65e0\u7f1d\u8bbf\u95ee&#xff0c;\u786e\u4fdd\u804a\u5929\u670d\u52a1\u5668\u80fd\u591f\u5728\u5e7f\u57df\u7f51\u4e2d\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<h2>\u9879\u76ee\u7ed3\u6784<\/h2>\n<p>|\u2014\u2014 include<br \/>\n|    |\u2014\u2014 \u5934\u6587\u4ef6&#xff08;.h \u6587\u4ef6&#xff09;<br \/>\n|\u2014\u2014 src<br \/>\n|    |\u2014\u2014 httpd<br \/>\n|    |    |\u2014\u2014 \u5904\u7406 HTTP \u8bf7\u6c42\u7684\u6e90\u4ee3\u7801\u6587\u4ef6<br \/>\n|    |\u2014\u2014 message<br \/>\n|    |    |\u2014\u2014 \u5b9e\u73b0\u7b80\u5355\u7684\u7c7b\u4f3c JSON \u529f\u80fd\u7684\u6e90\u4ee3\u7801\u6587\u4ef6<br \/>\n|    |\u2014\u2014 transaction<br \/>\n|    |    |\u2014\u2014 \u4e8b\u52a1\u5904\u7406\u7684\u6e90\u4ee3\u7801\u6587\u4ef6<br \/>\n|\u2014\u2014 CMakeLists.txt<br \/>\n|\u2014\u2014 build<br \/>\n|    |\u2014\u2014 httpd<br \/>\n|    |    |\u2014\u2014 index.html<br \/>\n|\u2014\u2014 .clang-format<\/p>\n<h2>\u8fd0\u884c\u8bf4\u660e<\/h2>\n<li>\n<p>\u8fdb\u5165 build \u76ee\u5f55<\/p>\n<p>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p> <span class=\"token builtin class-name\">cd<\/span> build\n <\/li>\n<li>\n<p>\u751f\u6210\u6784\u5efa\u6587\u4ef6<\/p>\n<p>\u4f7f\u7528 cmake \u751f\u6210\u6784\u5efa\u6587\u4ef6&#xff1a;<\/p>\n<p> cmake <span class=\"token punctuation\">..<\/span>\n <\/li>\n<li>\n<p>\u7f16\u8bd1\u9879\u76ee<\/p>\n<p>\u4f7f\u7528 make \u7f16\u8bd1\u9879\u76ee&#xff1a;<\/p>\n<p> <span class=\"token function\">make<\/span>\n <\/li>\n<p>\u200b \u6b64\u65f6\u5728build\u76ee\u5f55\u4e0b\u51fa\u73b0HTTPD\u548ctransaction\u4e24\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f\u3002<\/p>\n<li>\n<p>\u542f\u52a8\u4e8b\u52a1\u5904\u7406\u670d\u52a1\u5668&#xff08;\u6e90\u7801\u4e2d\u8bbe\u7f6e\u8fd0\u884c\u57287002\u7aef\u53e3&#xff09;<\/p>\n<p>\u5728 build \u76ee\u5f55\u4e0b\u8fd0\u884c\u4e8b\u52a1\u5904\u7406\u670d\u52a1\u5668&#xff1a;<\/p>\n<p> .\/transaction\n <\/li>\n<li>\n<p>\u8fd0\u884cHTTP \u670d\u52a1<\/p>\n<p>\u5728 build \u76ee\u5f55\u4e0b\u542f\u52a8 HTTP \u670d\u52a1\u5668&#xff08;\u6e90\u7801\u4e2d\u8bbe\u7f6e\u8fd0\u884c\u57287001\u7aef\u53e3&#xff09;&#xff1a;<\/p>\n<p> .\/HTTPD\n <\/li>\n<li>\n<p>\u542f\u52a8HTTP\u670d\u52a1<\/p>\n<p> twh&#064;TWH:~\/TinyBridge\/build$ .\/HTTPD<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n<span class=\"token operator\">|<\/span> Command List:                           <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">1<\/span>. start        &#8211; Start the server      <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">2<\/span>. stop         &#8211; Stop the server       <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">3<\/span>. <span class=\"token builtin class-name\">exit<\/span>         &#8211; Exit the console      <span class=\"token operator\">|<\/span><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nEnter command: start<br \/>\nStarting server on port <span class=\"token number\">7001<\/span><span class=\"token punctuation\">..<\/span>.<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n<span class=\"token operator\">|<\/span> Command List:                           <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">1<\/span>. start        &#8211; Start the server      <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">2<\/span>. stop         &#8211; Stop the server       <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">3<\/span>. <span class=\"token builtin class-name\">exit<\/span>         &#8211; Exit the console      <span class=\"token operator\">|<\/span><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nEnter command: stop<br \/>\nStopping server on port <span class=\"token number\">7001<\/span><span class=\"token punctuation\">..<\/span>.<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n<span class=\"token operator\">|<\/span> Command List:                           <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">1<\/span>. start        &#8211; Start the server      <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">2<\/span>. stop         &#8211; Stop the server       <span class=\"token operator\">|<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token number\">3<\/span>. <span class=\"token builtin class-name\">exit<\/span>         &#8211; Exit the console      <span class=\"token operator\">|<\/span><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nEnter command: <span class=\"token builtin class-name\">exit<\/span><br \/>\nExiting console<span class=\"token punctuation\">..<\/span>.\n <\/li>\n<li>\n<p>\u6253\u5f00wsl setting\u8bbe\u7f6eWindows\u5b50\u7cfb\u7edfwsl\u7684\u7f51\u7edc\u6a21\u5f0f\u4e3a\u955c\u50cf<\/p>\n<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418154242-680272f22b57f.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418154242-680272f273834.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u6b64\u65f6wsl\u4e0eWindows\u4fbf\u5171\u7528\u4e00\u4e2aIP\u5730\u5740\u3002<\/p>\n<li>\n<p>\u6b64\u65f6\u5728\u6d4f\u89c8\u5668\u8f93\u5165http:\/\/localhost:7001\/\u4fbf\u53ef\u4ee5\u8bbf\u95ee\u7f51\u9875<\/p>\n<p>\u5176\u4ed6\u8bbe\u5907\u5728\u6d4f\u89c8\u5668\u8f93\u5165[\u4e3b\u673aIP]:7001\u4e5f\u53ef\u4ee5\u8bbf\u95ee\u7f51\u9875\u3002<\/p>\n<p>\u4f46\u6b64\u65f6\u7531\u4e8e\u6211\u4eec\u4f7f\u7528\u7684\u4e0d\u662f\u516c\u7f51IP&#xff0c;\u6240\u4ee5\u5982\u679c\u5206\u4eab\u7ed9\u4e0d\u5728\u6211\u4eec\u5c40\u57df\u7f51\u5185\u7684\u5c0f\u4f19\u4f34&#xff0c;\u5219\u4f1a\u8bbf\u95ee\u4e0d\u5230\u3002\u7533\u8bf7\u516c\u7f51IP\u6bd4\u8f83\u9ebb\u70e6&#xff0c;\u800c\u4f7f\u7528\u5185\u7f51\u7a7f\u900f\u6280\u672f\u53ef\u4ee5\u7b80\u5355\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee\u3002<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770bHTTP\u670d\u52a1\u5668\u65e5\u5fd7<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418154243-680272f347d9d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<h2>\u5185\u7f51\u7a7f\u900f<\/h2>\n<p>\u6211\u4f7f\u7528\u7684\u662f\u8d1d\u9510\u82b1\u751f\u58f3\u5185\u7f51\u7a7f\u900f|ddns\u52a8\u6001\u57df\u540d\u89e3\u6790|\u7aef\u53e3\u6620\u5c04\u5de5\u5177-\u8d1d\u9510\u82b1\u751f\u58f3\u5b98\u7f51\u6765\u8fdb\u884c\u5185\u7f51\u7a7f\u900f\u7684\u3002<\/p>\n<p>\u5c06\u4e3b\u673aIP\u6620\u5c04\u5230\u5206\u914d\u7684\u7f51\u7ad9\u57df\u540d\u5373\u53ef\u5b9e\u73b0\u516c\u7f51\u8bbf\u95ee\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418154244-680272f4646a3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>\u5f02\u5e38\u5904\u7406<\/h2>\n<h3>wsl\u7f51\u7edc\u8bbe\u7f6e<\/h3>\n<p>\u65b0\u7248 WSL2 2.0 \u8bbe\u7f6e Windows \u548c WSL \u955c\u50cf\u7f51\u7edc\u6559\u7a0b_wsl\u7f51\u7edc\u8bbe\u7f6e-CSDN\u535a\u5ba2<\/p>\n<h3>\u7aef\u53e3\u963b\u585e<\/h3>\n<p>\u5efa\u8bae\u5728\u9000\u51faHTTP\u670d\u52a1\u5668\u63a7\u5236\u53f0\u4e4b\u524d\u5148\u6267\u884cstop\u547d\u4ee4\u5173\u95edTCP\u5957\u63a5\u5b57\u3002<\/p>\n<p>twh&#064;TWH:~\/TinyBridge\/build$ .\/transaction<br \/>\nterminate called after throwing an instance of <span class=\"token string\">&#039;std::runtime_error&#039;<\/span><br \/>\n  what<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>:  Failed to <span class=\"token builtin class-name\">bind<\/span> socket<br \/>\nAborted <span class=\"token punctuation\">(<\/span>core dumped<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u4f7f\u7528 lsof \u548c kill \u547d\u4ee4<\/p>\n<li>\n<p>\u67e5\u627e\u5360\u7528\u7aef\u53e3\u7684\u8fdb\u7a0b \u4f7f\u7528 lsof \u547d\u4ee4\u67e5\u627e\u5360\u7528\u6307\u5b9a\u7aef\u53e3\u7684\u8fdb\u7a0b&#xff1a;<\/p>\n<p> <span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-i<\/span> :\u7aef\u53e3\u53f7<\/p>\n<p>\u4f8b\u5982&#xff0c;\u67e5\u627e\u5360\u7528\u7aef\u53e3 8080 \u7684\u8fdb\u7a0b&#xff1a;<\/p>\n<p> <span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-i<\/span> :8080<\/p>\n<p>\u8f93\u51fa\u793a\u4f8b&#xff1a;<\/p>\n<p> COMMAND   PID USER   FD   TYPE DEVICE SIZE\/OFF NODE NAME<br \/>\nnode    12345  user   20u  IPv6 123456      0t0  TCP *:http-alt (LISTEN)<\/p>\n<p>\u5176\u4e2d&#xff0c;PID \u662f\u8fdb\u7a0b ID\u3002<\/p>\n<\/li>\n<li>\n<p>\u6740\u6b7b\u8fdb\u7a0b \u4f7f\u7528 kill \u547d\u4ee4\u6740\u6b7b\u8fdb\u7a0b&#xff1a;<\/p>\n<p> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span> PID<\/p>\n<p>\u4f8b\u5982&#xff0c;\u6740\u6b7b PID \u4e3a 12345 \u7684\u8fdb\u7a0b&#xff1a;<\/p>\n<p> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span> <span class=\"token number\">12345<\/span>\n <\/li>\n<li>\n<p>\u5f3a\u5236\u6740\u6b7b\u8fdb\u7a0b&#xff08;\u5982\u679c kill \u65e0\u6548&#xff09; \u5982\u679c kill \u547d\u4ee4\u65e0\u6548&#xff0c;\u53ef\u4ee5\u5c1d\u8bd5\u5f3a\u5236\u6740\u6b7b\u8fdb\u7a0b&#xff1a;<\/p>\n<p> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span> <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-t<\/span> <span class=\"token parameter variable\">-i<\/span> :\u7aef\u53e3\u53f7<span class=\"token variable\">)<\/span><\/span><\/p>\n<p>\u4f8b\u5982&#xff0c;\u5f3a\u5236\u6740\u6b7b\u5360\u7528\u7aef\u53e3 8080 \u7684\u8fdb\u7a0b&#xff1a;<\/p>\n<p> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span> <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-t<\/span> <span class=\"token parameter variable\">-i<\/span> :8080<span class=\"token variable\">)<\/span><\/span>\n <\/li>\n<h2>\u5176\u4ed6<\/h2>\n<p>\u6b64\u9879\u76ee\u662f\u672c\u4eba\u5728\u5b66\u4e60\u8ba1\u7b97\u673a\u7f51\u7edc\u7684\u65f6\u5019\u7a81\u53d1\u5947\u60f3\u6784\u5efa\u7684&#xff0c;\u6574\u4f53\u6bd4\u8f83\u7b80\u6d01&#xff0c;\u6b22\u8fce\u5927\u5bb6\u591a\u591a\u63d0\u5efa\u8bae&#xff0c;\u591a\u591astar&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb983\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf21\u6b21\u3002\u652f\u6301\u591a\u7528\u6237\u5728\u7ebf\u5b9e\u65f6\u804a\u5929\uff0c\u6d88\u606f\u901a\u8fc7\u670d\u52a1\u5668\u9ad8\u6548\u8f6c\u53d1\uff0c\u786e\u4fdd\u6240\u6709\u7528\u6237\u540c\u6b65\u63a5\u6536\u6700\u65b0\u804a\u5929\u5185\u5bb9\u3002HTTP\u670d\u52a1\u5668\u91c7\u7528C++\u5b9e\u73b0\uff0c\u652f\u6301\u5904\u7406\u5e38\u89c1\u7684HTTP\u8bf7\u6c42\uff08\u5982GET\u3001POST\uff09\uff0c\u80fd\u591f\u89e3\u6790\u6d4f\u89c8\u5668\u8bf7\u6c42\u5e76\u751f\u6210\u5bf9\u5e94\u7684HTTP\u54cd\u5e94\uff0c\u786e\u4fdd\u4e0e\u5ba2\u6237\u7aef\u7684\u9ad8\u6548\u4ea4\u4e92\u3002\u5b9e\u73b0\u65e5\u5fd7\u7684\u5199\u5165\uff0c\u65b9\u4fbfHTTP\u670d\u52a1\u5668\u8c03\u8bd5\u3002\u8fdb\u7a0b\u95f4\u901a\u4fe1\u901a\u8fc7\u8fdb\u7a0b\u5957\u63a5\u5b57\uff08IPC Socket\uff09\u5b9e\u73b0\u670d\u52a1\u5668\u4e0e\u4e8b\u52a1\u5904\u7406\u6a21\u5757\u4e4b\u95f4\u7684\u9ad8\u6548\u901a\u4fe1\uff0c\u786e\u4fdd\u6570\u636e\u4f20\u9012\u7684\u53ef\u9760\u6027\u4e0e\u5b9e\u65f6\u6027\u3002\u524d\u7aef\u9875\u9762\u63d0\u4f9b\u7b80\u6613\u7684\u804a\u5929\u9875\u9762\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u5e76\u53c2\u4e0e\u804a\u5929\u3002_windows wsl c++<\/p>\n","protected":false},"author":2,"featured_media":17289,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,567,58,149,43,211],"topic":[],"class_list":["post-17294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-html","tag-linux","tag-windows","tag-43","tag-211"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668 - \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\/17294.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb983\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf21\u6b21\u3002\u652f\u6301\u591a\u7528\u6237\u5728\u7ebf\u5b9e\u65f6\u804a\u5929\uff0c\u6d88\u606f\u901a\u8fc7\u670d\u52a1\u5668\u9ad8\u6548\u8f6c\u53d1\uff0c\u786e\u4fdd\u6240\u6709\u7528\u6237\u540c\u6b65\u63a5\u6536\u6700\u65b0\u804a\u5929\u5185\u5bb9\u3002HTTP\u670d\u52a1\u5668\u91c7\u7528C++\u5b9e\u73b0\uff0c\u652f\u6301\u5904\u7406\u5e38\u89c1\u7684HTTP\u8bf7\u6c42\uff08\u5982GET\u3001POST\uff09\uff0c\u80fd\u591f\u89e3\u6790\u6d4f\u89c8\u5668\u8bf7\u6c42\u5e76\u751f\u6210\u5bf9\u5e94\u7684HTTP\u54cd\u5e94\uff0c\u786e\u4fdd\u4e0e\u5ba2\u6237\u7aef\u7684\u9ad8\u6548\u4ea4\u4e92\u3002\u5b9e\u73b0\u65e5\u5fd7\u7684\u5199\u5165\uff0c\u65b9\u4fbfHTTP\u670d\u52a1\u5668\u8c03\u8bd5\u3002\u8fdb\u7a0b\u95f4\u901a\u4fe1\u901a\u8fc7\u8fdb\u7a0b\u5957\u63a5\u5b57\uff08IPC Socket\uff09\u5b9e\u73b0\u670d\u52a1\u5668\u4e0e\u4e8b\u52a1\u5904\u7406\u6a21\u5757\u4e4b\u95f4\u7684\u9ad8\u6548\u901a\u4fe1\uff0c\u786e\u4fdd\u6570\u636e\u4f20\u9012\u7684\u53ef\u9760\u6027\u4e0e\u5b9e\u65f6\u6027\u3002\u524d\u7aef\u9875\u9762\u63d0\u4f9b\u7b80\u6613\u7684\u804a\u5929\u9875\u9762\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u5e76\u53c2\u4e0e\u804a\u5929\u3002_windows wsl c++\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/17294.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T15:42:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418154240-680272f09b144.jpg\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/17294.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/17294.html\",\"name\":\"\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T15:42:45+00:00\",\"dateModified\":\"2025-04-18T15:42:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/17294.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/17294.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/17294.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668\"}]},{\"@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":"\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668 - \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\/17294.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb983\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf21\u6b21\u3002\u652f\u6301\u591a\u7528\u6237\u5728\u7ebf\u5b9e\u65f6\u804a\u5929\uff0c\u6d88\u606f\u901a\u8fc7\u670d\u52a1\u5668\u9ad8\u6548\u8f6c\u53d1\uff0c\u786e\u4fdd\u6240\u6709\u7528\u6237\u540c\u6b65\u63a5\u6536\u6700\u65b0\u804a\u5929\u5185\u5bb9\u3002HTTP\u670d\u52a1\u5668\u91c7\u7528C++\u5b9e\u73b0\uff0c\u652f\u6301\u5904\u7406\u5e38\u89c1\u7684HTTP\u8bf7\u6c42\uff08\u5982GET\u3001POST\uff09\uff0c\u80fd\u591f\u89e3\u6790\u6d4f\u89c8\u5668\u8bf7\u6c42\u5e76\u751f\u6210\u5bf9\u5e94\u7684HTTP\u54cd\u5e94\uff0c\u786e\u4fdd\u4e0e\u5ba2\u6237\u7aef\u7684\u9ad8\u6548\u4ea4\u4e92\u3002\u5b9e\u73b0\u65e5\u5fd7\u7684\u5199\u5165\uff0c\u65b9\u4fbfHTTP\u670d\u52a1\u5668\u8c03\u8bd5\u3002\u8fdb\u7a0b\u95f4\u901a\u4fe1\u901a\u8fc7\u8fdb\u7a0b\u5957\u63a5\u5b57\uff08IPC Socket\uff09\u5b9e\u73b0\u670d\u52a1\u5668\u4e0e\u4e8b\u52a1\u5904\u7406\u6a21\u5757\u4e4b\u95f4\u7684\u9ad8\u6548\u901a\u4fe1\uff0c\u786e\u4fdd\u6570\u636e\u4f20\u9012\u7684\u53ef\u9760\u6027\u4e0e\u5b9e\u65f6\u6027\u3002\u524d\u7aef\u9875\u9762\u63d0\u4f9b\u7b80\u6613\u7684\u804a\u5929\u9875\u9762\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u5e76\u53c2\u4e0e\u804a\u5929\u3002_windows wsl c++","og_url":"https:\/\/www.wsisp.com\/helps\/17294.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T15:42:45+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418154240-680272f09b144.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/17294.html","url":"https:\/\/www.wsisp.com\/helps\/17294.html","name":"\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T15:42:45+00:00","dateModified":"2025-04-18T15:42:45+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/17294.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/17294.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/17294.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5728Windows\u5b50\u7cfb\u7edfWSL\uff08Linux\uff09\u4e2d\u7528C++\u642d\u5efa\u7b80\u5355\u804a\u5929\u670d\u52a1\u5668"}]},{"@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\/17294","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=17294"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/17294\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/17289"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=17294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=17294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=17294"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=17294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}