{"id":50824,"date":"2025-08-10T12:34:28","date_gmt":"2025-08-10T04:34:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/50824.html"},"modified":"2025-08-10T12:34:28","modified_gmt":"2025-08-10T04:34:28","slug":"c-%e4%bb%8e%e9%a2%84%e5%a4%84%e7%90%86%e5%88%b0%e7%94%9f%e6%88%90%e5%8f%af%e6%89%a7%e8%a1%8c%e6%96%87%e4%bb%b6%e7%ae%80%e5%8d%95%e4%bb%8b%e7%bb%8d%e5%92%8c%e4%b8%ad%e9%97%b4%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/50824.html","title":{"rendered":"C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b"},"content":{"rendered":"<p>\u5728 C&#043;&#043; \u4e2d&#xff0c;\u4ece\u6e90\u4ee3\u7801\u5230\u6700\u7ec8\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u4f1a\u7ecf\u5386\u591a\u4e2a\u9636\u6bb5&#xff0c;\u4e3b\u8981\u5305\u62ec&#xff1a;<\/p>\n<hr \/>\n<h3>\u603b\u4f53\u6d41\u7a0b\u6982\u89c8<\/h3>\n<p>\u6e90\u6587\u4ef6 (.cpp\/.h)<br \/>\n   \u2193   [1. \u9884\u5904\u7406]<br \/>\n\u9884\u5904\u7406\u540e\u7684\u4ee3\u7801 (.i)<br \/>\n   \u2193   [2. \u7f16\u8bd1]<br \/>\n\u6c47\u7f16\u4ee3\u7801 (.s)<br \/>\n   \u2193   [3. \u6c47\u7f16]<br \/>\n\u76ee\u6807\u6587\u4ef6 (.o)<br \/>\n   \u2193   [4. \u94fe\u63a5]<br \/>\n\u53ef\u6267\u884c\u6587\u4ef6 (a.out \u6216\u6307\u5b9a\u540d\u79f0)<\/p>\n<hr \/>\n<h3>\u5404\u9636\u6bb5\u8be6\u89e3\u53ca\u793a\u4f8b<\/h3>\n<p>\u4e0b\u9762\u6211\u4eec\u4ee5\u7b80\u5355\u7684\u793a\u4f8b\u6587\u4ef6 main.cpp \u4e3a\u4f8b&#xff1a;<\/p>\n<h4>main.cpp \u5185\u5bb9\u5982\u4e0b&#xff1a;<\/h4>\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\">define<\/span> <span class=\"token macro-name\">PI<\/span> <span class=\"token expression\"><span class=\"token number\">3.14<\/span><\/span><\/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> <span class=\"token punctuation\">{<\/span><br \/>\n    std<span class=\"token operator\">::<\/span>cout <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">&#034;Hello, PI &#061; &#034;<\/span> <span class=\"token operator\">&lt;&lt;<\/span> PI <span class=\"token operator\">&lt;&lt;<\/span> std<span class=\"token operator\">::<\/span>endl<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<hr \/>\n<h4>\u30101\u3011\u9884\u5904\u7406&#xff08;Preprocessing&#xff09;<\/h4>\n<h5>\u547d\u4ee4&#xff1a;<\/h5>\n<p>g&#043;&#043; -E main.cpp -o main.i<\/p>\n<h5>\u529f\u80fd&#xff1a;<\/h5>\n<ul>\n<li>\u5c55\u5f00 #include \u6587\u4ef6&#xff1b;<\/li>\n<li>\u66ff\u6362\u5b8f\u5b9a\u4e49&#xff08;\u5982 PI&#xff09;&#xff1b;<\/li>\n<li>\u5904\u7406\u6761\u4ef6\u7f16\u8bd1&#xff1b;<\/li>\n<li>\u5220\u9664\u6ce8\u91ca\u3002<\/li>\n<\/ul>\n<h5>\u7ed3\u679c\u6587\u4ef6&#xff1a;<\/h5>\n<ul>\n<li>main.i&#xff1a;\u7eaf C&#043;&#043; \u6e90\u7801&#xff0c;\u6ca1\u6709\u4efb\u4f55\u5b8f\u6216\u5934\u6587\u4ef6\u6b8b\u7559\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>\u30102\u3011\u7f16\u8bd1&#xff08;Compiling&#xff09;<\/h4>\n<h5>\u547d\u4ee4&#xff1a;<\/h5>\n<p>g&#043;&#043; -S main.i -o main.s<\/p>\n<h5>\u529f\u80fd&#xff1a;<\/h5>\n<ul>\n<li>\u5c06\u9884\u5904\u7406\u540e\u7684\u4ee3\u7801\u7ffb\u8bd1\u4e3a\u6c47\u7f16\u4ee3\u7801&#xff1b;<\/li>\n<li>\u8fdb\u884c\u8bed\u6cd5\u5206\u6790\u3001\u8bed\u4e49\u68c0\u67e5\u3001\u751f\u6210\u6c47\u7f16\u6307\u4ee4\u3002<\/li>\n<\/ul>\n<h5>\u7ed3\u679c\u6587\u4ef6&#xff1a;<\/h5>\n<ul>\n<li>main.s&#xff1a;\u4eba\u7c7b\u53ef\u8bfb\u7684\u6c47\u7f16\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>\u30103\u3011\u6c47\u7f16&#xff08;Assembling&#xff09;<\/h4>\n<h5>\u547d\u4ee4&#xff1a;<\/h5>\n<p>g&#043;&#043; -c main.s -o main.o<\/p>\n<h5>\u529f\u80fd&#xff1a;<\/h5>\n<ul>\n<li>\u5c06\u6c47\u7f16\u4ee3\u7801\u8f6c\u6362\u6210\u673a\u5668\u6307\u4ee4&#xff08;\u4e8c\u8fdb\u5236&#xff09;&#xff1b;<\/li>\n<li>\u751f\u6210\u76ee\u6807\u6587\u4ef6&#xff08;Object File&#xff09;\u3002<\/li>\n<\/ul>\n<h5>\u7ed3\u679c\u6587\u4ef6&#xff1a;<\/h5>\n<ul>\n<li>main.o&#xff1a;\u4e8c\u8fdb\u5236\u683c\u5f0f\u7684\u76ee\u6807\u6587\u4ef6&#xff0c;\u5c1a\u4e0d\u80fd\u72ec\u7acb\u8fd0\u884c\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>\u30104\u3011\u94fe\u63a5&#xff08;Linking&#xff09;<\/h4>\n<h5>\u547d\u4ee4&#xff1a;<\/h5>\n<p>g&#043;&#043; main.o -o main<\/p>\n<h5>\u529f\u80fd&#xff1a;<\/h5>\n<ul>\n<li>\u5c06\u76ee\u6807\u6587\u4ef6\u4e0e\u6807\u51c6\u5e93&#xff08;\u5982 libstdc&#043;&#043;&#xff09;\u8fdb\u884c\u94fe\u63a5&#xff1b;<\/li>\n<li>\u89e3\u6790\u5916\u90e8\u7b26\u53f7&#xff08;\u5982 std::cout&#xff09;&#xff1b;<\/li>\n<li>\u5408\u5e76\u6bb5&#xff08;.text\/.data\/.bss&#xff09;&#xff1b;<\/li>\n<li>\u751f\u6210\u6700\u7ec8\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h5>\u7ed3\u679c\u6587\u4ef6&#xff1a;<\/h5>\n<ul>\n<li>main&#xff1a;\u53ef\u6267\u884c\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e00\u6761\u547d\u4ee4\u76f4\u63a5\u5b8c\u6210\u5168\u90e8\u6d41\u7a0b<\/h3>\n<p>g&#043;&#043; main.cpp -o main<\/p>\n<p>g&#043;&#043; \u4f1a\u81ea\u52a8\u6309\u987a\u5e8f\u5b8c\u6210&#xff1a;<\/p>\n<ul>\n<li>\u9884\u5904\u7406 \u2192 \u7f16\u8bd1 \u2192 \u6c47\u7f16 \u2192 \u94fe\u63a5\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u603b\u7ed3&#xff1a;\u6bcf\u6b65\u8f93\u5165\u8f93\u51fa\u6587\u4ef6\u5173\u7cfb\u56fe<\/h3>\n<p>main.cpp<br \/>\n   \u2193 g&#043;&#043; -E<br \/>\nmain.i<br \/>\n   \u2193 g&#043;&#043; -S<br \/>\nmain.s<br \/>\n   \u2193 g&#043;&#043; -c<br \/>\nmain.o<br \/>\n   \u2193 g&#043;&#043;<br \/>\nmain (\u53ef\u6267\u884c\u6587\u4ef6)<\/p>\n<hr \/>\n<h3>\u9644\u52a0\u8bf4\u660e<\/h3>\n<table>\n<tr>\u9636\u6bb5\u5e38\u89c1\u540e\u7f00\u5de5\u5177\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u9884\u5904\u7406<\/td>\n<td>.i<\/td>\n<td>cpp<\/td>\n<td>\u7528\u4e8e\u5b8f\u5c55\u5f00\u3001\u5305\u542b\u5934\u6587\u4ef6\u7b49<\/td>\n<\/tr>\n<tr>\n<td>\u7f16\u8bd1<\/td>\n<td>.s<\/td>\n<td>cc1plus<\/td>\n<td>C&#043;&#043; \u7f16\u8bd1\u5668\u524d\u7aef&#xff0c;\u751f\u6210\u6c47\u7f16<\/td>\n<\/tr>\n<tr>\n<td>\u6c47\u7f16<\/td>\n<td>.o<\/td>\n<td>as<\/td>\n<td>\u6c47\u7f16\u5668&#xff0c;\u5c06\u6c47\u7f16\u751f\u6210\u76ee\u6807\u4ee3\u7801<\/td>\n<\/tr>\n<tr>\n<td>\u94fe\u63a5<\/td>\n<td>\u65e0\u7279\u5b9a\u540e\u7f00&#xff08;\u7ed3\u679c\u4e3a .out \u6216\u81ea\u5b9a\u4e49&#xff09;<\/td>\n<td>ld<\/td>\n<td>\u94fe\u63a5\u5668&#xff0c;\u6574\u5408\u4ee3\u7801\u4e0e\u5e93<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>C&#043;&#043; \u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u4e2d\u95f4\u6587\u4ef6\u7684\u5185\u5bb9\u67e5\u770b<\/h3>\n<p>\u4e3b\u8981\u7684\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<li>.i \u6587\u4ef6&#xff08;\u9884\u5904\u7406\u540e&#xff09;<\/li>\n<li>.s \u6587\u4ef6&#xff08;\u6c47\u7f16\u4ee3\u7801&#xff09;<\/li>\n<li>.o \u6587\u4ef6&#xff08;\u76ee\u6807\u6587\u4ef6&#xff0c;\u67e5\u770b\u7b26\u53f7\u8868\u3001\u53cd\u6c47\u7f16&#xff09;<\/li>\n<hr \/>\n<h3>\u793a\u4f8b\u4ee3\u7801 main.cpp<\/h3>\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\">define<\/span> <span class=\"token macro-name\">PI<\/span> <span class=\"token expression\"><span class=\"token number\">3.14<\/span><\/span><\/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> <span class=\"token punctuation\">{<\/span><br \/>\n    std<span class=\"token operator\">::<\/span>cout <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">&#034;PI &#061; &#034;<\/span> <span class=\"token operator\">&lt;&lt;<\/span> PI <span class=\"token operator\">&lt;&lt;<\/span> std<span class=\"token operator\">::<\/span>endl<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<hr \/>\n<h3>\u7b2c\u4e00\u6b65&#xff1a;\u67e5\u770b .i \u6587\u4ef6&#xff08;\u9884\u5904\u7406\u8f93\u51fa&#xff09;<\/h3>\n<p>g&#043;&#043; -E main.cpp -o main.i<\/p>\n<h4>\u67e5\u770b\u5185\u5bb9&#xff08;\u90e8\u5206\u622a\u53d6&#xff09;&#xff1a;<\/h4>\n<p><span class=\"token keyword\">extern<\/span> std<span class=\"token operator\">::<\/span>ostream cout<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> <span class=\"token punctuation\">{<\/span><br \/>\n    std<span class=\"token operator\">::<\/span>cout <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">&#034;PI &#061; &#034;<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token number\">3.14<\/span> <span class=\"token operator\">&lt;&lt;<\/span> std<span class=\"token operator\">::<\/span>endl<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>\u5206\u6790\u91cd\u70b9&#xff1a;<\/h4>\n<ul>\n<li>#include &lt;iostream&gt; \u88ab\u5c55\u5f00\u6210\u4e86\u5927\u91cf\u7cfb\u7edf\u5934\u6587\u4ef6&#xff1b;<\/li>\n<li>\u5b8f PI \u88ab\u66ff\u6362\u4e3a 3.14&#xff1b;<\/li>\n<li>\u6240\u6709\u6ce8\u91ca\u88ab\u79fb\u9664&#xff1b;<\/li>\n<li>\u6761\u4ef6\u7f16\u8bd1\u6307\u4ee4\u5df2\u89e3\u6790\u5b8c\u6210\u3002<\/li>\n<\/ul>\n<p>\u53ef\u4ee5\u901a\u8fc7 less main.i \u6216 grep \u8fc7\u6ee4\u67e5\u770b\u5173\u952e\u4ee3\u7801\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c\u6b65&#xff1a;\u67e5\u770b .s \u6587\u4ef6&#xff08;\u6c47\u7f16\u4ee3\u7801&#xff09;<\/h3>\n<p>g&#043;&#043; -S main.cpp -o main.s<\/p>\n<h4>\u67e5\u770b\u90e8\u5206\u6c47\u7f16\u5185\u5bb9&#xff08;AT&amp;T \u8bed\u6cd5&#xff09;&#xff1a;<\/h4>\n<p>.LC0:<br \/>\n    .string &#034;PI &#061; &#034;<br \/>\n.LC1:<br \/>\n    .string &#034;\\\\n&#034;<\/p>\n<p>main:<br \/>\n    pushq   %rbp<br \/>\n    movq    %rsp, %rbp<br \/>\n    movsd   .LC2(%rip), %xmm0<br \/>\n    leaq    .LC0(%rip), %rdi<br \/>\n    call    std::operator&lt;&lt;(&#8230;)<\/p>\n<h4>\u5206\u6790\u91cd\u70b9&#xff1a;<\/h4>\n<ul>\n<li>.LCx \u662f\u5e38\u91cf\u6c60\u5b57\u7b26\u4e32&#xff1b;<\/li>\n<li>\u4f7f\u7528 %rip \u5730\u5740\u76f8\u5bf9\u5bfb\u5740&#xff1b;<\/li>\n<li>xmm0 \u662f\u6d6e\u70b9\u5bc4\u5b58\u5668&#xff08;\u56e0\u4e3a 3.14 \u662f\u6d6e\u70b9\u6570&#xff09;&#xff1b;<\/li>\n<li>call \u8c03\u7528 C&#043;&#043; \u7684\u91cd\u8f7d\u51fd\u6570&#xff08;\u901a\u8fc7\u7b26\u53f7\u8868\u8fde\u63a5&#xff09;&#xff1b;<\/li>\n<\/ul>\n<p>\u53ef\u4ee5\u4f7f\u7528 less main.s \u6216\u7f16\u8f91\u5668\u9605\u8bfb\u5b83&#xff0c;\u4e5f\u53ef\u4ee5\u7528 objdump \u67e5\u770b\u6c47\u7f16\u540e\u7684 .o \u6587\u4ef6&#xff08;\u4e0b\u65b9\u8bb2\u89e3&#xff09;\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e09\u6b65&#xff1a;\u67e5\u770b .o \u6587\u4ef6\u5185\u5bb9&#xff08;\u76ee\u6807\u6587\u4ef6&#xff09;<\/h3>\n<p>g&#043;&#043; -c main.cpp -o main.o<\/p>\n<hr \/>\n<h4>1. \u67e5\u770b\u7b26\u53f7\u8868<\/h4>\n<p>nm main.o<\/p>\n<h5>\u793a\u4f8b\u8f93\u51fa&#xff1a;<\/h5>\n<p>0000000000000000 T main<br \/>\n                 U std::cout<br \/>\n                 U std::endl(&#8230;)<\/p>\n<table>\n<tr>\u6807\u8bb0\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>T<\/td>\n<td>\u5728 .text&#xff08;\u4ee3\u7801\u6bb5&#xff09;\u4e2d\u7684\u5168\u5c40\u7b26\u53f7<\/td>\n<\/tr>\n<tr>\n<td>U<\/td>\n<td>\u672a\u5b9a\u4e49\u7b26\u53f7&#xff08;\u5c06\u5728\u94fe\u63a5\u65f6\u89e3\u6790&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h4>2. \u53cd\u6c47\u7f16 .o \u6587\u4ef6<\/h4>\n<p>objdump -d main.o<\/p>\n<h5>\u793a\u4f8b\u8f93\u51fa\u7247\u6bb5&#xff1a;<\/h5>\n<p>0000000000000000 &lt;main&gt;:<br \/>\n   0:   55                      push   %rbp<br \/>\n   1:   48 89 e5                mov    %rsp,%rbp<br \/>\n   4:   &#8230;<\/p>\n<p>\u8fd9\u662f\u4e8c\u8fdb\u5236\u673a\u5668\u7801\u53cd\u6c47\u7f16\u51fa\u7684\u6c47\u7f16&#xff0c;\u65b9\u4fbf\u5bf9\u6bd4 .s \u6587\u4ef6\u4e0e\u771f\u5b9e\u673a\u5668\u7801\u7684\u6307\u4ee4\u3002<\/p>\n<hr \/>\n<h4>3. \u67e5\u770b\u8282\u533a\u7ed3\u6784&#xff08;section headers&#xff09;<\/h4>\n<p>readelf -S main.o<\/p>\n<h5>\u8f93\u51fa\u90e8\u5206\u8282\u533a\u8bf4\u660e&#xff1a;<\/h5>\n<table>\n<tr>\u8282\u533a\u540d\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>.text<\/td>\n<td>\u7a0b\u5e8f\u6307\u4ee4&#xff08;\u53ef\u6267\u884c\u4ee3\u7801&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>.data<\/td>\n<td>\u5df2\u521d\u59cb\u5316\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>.bss<\/td>\n<td>\u672a\u521d\u59cb\u5316\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>.rodata<\/td>\n<td>\u53ea\u8bfb\u6570\u636e&#xff08;\u5b57\u7b26\u4e32\u5e38\u91cf\u7b49&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>.symtab<\/td>\n<td>\u7b26\u53f7\u8868<\/td>\n<\/tr>\n<tr>\n<td>.strtab<\/td>\n<td>\u5b57\u7b26\u4e32\u8868<\/td>\n<\/tr>\n<tr>\n<td>.rel.text<\/td>\n<td>\u7528\u4e8e\u94fe\u63a5\u7684\u91cd\u5b9a\u4f4d\u4fe1\u606f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4f7f\u7528\u5efa\u8bae&#xff1a;<\/h3>\n<table>\n<tr>\u76ee\u6807\u547d\u4ee4\u5de5\u5177<\/tr>\n<tbody>\n<tr>\n<td>\u67e5\u770b\u9884\u5904\u7406\u4ee3\u7801<\/td>\n<td>g&#043;&#043; -E main.cpp -o main.i<\/td>\n<td>\u7eaf\u6587\u672c<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u6c47\u7f16\u4ee3\u7801<\/td>\n<td>g&#043;&#043; -S main.cpp -o main.s<\/td>\n<td>\u7eaf\u6587\u672c<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u7b26\u53f7\u8868<\/td>\n<td>nm main.o<\/td>\n<td>\u67e5\u770b\u94fe\u63a5\u4f9d\u8d56\u7b26\u53f7<\/td>\n<\/tr>\n<tr>\n<td>\u53cd\u6c47\u7f16\u4ee3\u7801<\/td>\n<td>objdump -d main.o<\/td>\n<td>\u4e8c\u8fdb\u5236\u2192\u6c47\u7f16<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u6bb5\u7ed3\u6784<\/td>\n<td>readelf -S main.o<\/td>\n<td>\u67e5\u770b ELF \u8282\u533a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e55\u6b21\uff0c\u6536\u85cf13\u6b21\u3002main.cpp\u2193 g++ -Emain.i\u2193 g++ -Smain.s\u2193 g++ -cmain.o\u2193 g++main (\u53ef\u6267\u884c\u6587\u4ef6)<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,4959,174,4958,190,4957],"topic":[],"class_list":{"0":"post-50824","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-server","7":"tag-c","10":"tag-4958","11":"tag-190","12":"tag-4957"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b - \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\/50824.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e55\u6b21\uff0c\u6536\u85cf13\u6b21\u3002main.cpp\u2193 g++ -Emain.i\u2193 g++ -Smain.s\u2193 g++ -cmain.o\u2193 g++main (\u53ef\u6267\u884c\u6587\u4ef6)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/50824.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T04:34:28+00:00\" \/>\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\/50824.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/50824.html\",\"name\":\"C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T04:34:28+00:00\",\"dateModified\":\"2025-08-10T04:34:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/50824.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/50824.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50824.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b\"}]},{\"@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":"C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b - \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\/50824.html","og_locale":"zh_CN","og_type":"article","og_title":"C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e55\u6b21\uff0c\u6536\u85cf13\u6b21\u3002main.cpp\u2193 g++ -Emain.i\u2193 g++ -Smain.s\u2193 g++ -cmain.o\u2193 g++main (\u53ef\u6267\u884c\u6587\u4ef6)","og_url":"https:\/\/www.wsisp.com\/helps\/50824.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T04:34:28+00:00","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\/50824.html","url":"https:\/\/www.wsisp.com\/helps\/50824.html","name":"C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T04:34:28+00:00","dateModified":"2025-08-10T04:34:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/50824.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/50824.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/50824.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C++ \u4ece\u9884\u5904\u7406\u5230\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7b80\u5355\u4ecb\u7ecd\u548c\u4e2d\u95f4\u6587\u4ef6\u67e5\u770b"}]},{"@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\/50824","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=50824"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50824\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=50824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=50824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=50824"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=50824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}