{"id":66997,"date":"2026-01-27T23:41:20","date_gmt":"2026-01-27T15:41:20","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/66997.html"},"modified":"2026-01-27T23:41:20","modified_gmt":"2026-01-27T15:41:20","slug":"trae%e9%85%8d%e7%bd%aemingw%e7%bc%96%e8%af%91c%e5%85%a8%e6%94%bb%e7%95%a5","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/66997.html","title":{"rendered":"Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565"},"content":{"rendered":"<p>\u597d\u7684&#xff0c;\u4f7f\u7528 Trae \u7f16\u8bd1 C&#043;&#043; \u7a0b\u5e8f\u9700\u8981\u914d\u7f6e\u5916\u90e8\u5de5\u5177\u94fe&#xff08;\u5982 MinGW&#xff09;&#xff0c;\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4&#xff1a;<\/p>\n<hr \/>\n<h4>1. \u5b89\u88c5 MinGW<\/h4>\n<ul>\n<li>\u4e0b\u8f7d&#xff1a;\u524d\u5f80 MinGW-w64 \u5b98\u7f51 \u4e0b\u8f7d\u5b89\u88c5\u5305&#xff08;\u63a8\u8350\u9009\u62e9 x86_64-win32-seh \u7248\u672c&#xff09;\u3002<\/li>\n<li>\u5b89\u88c5&#xff1a;\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f&#xff0c;\u8bbe\u7f6e\u5b89\u88c5\u8def\u5f84&#xff08;\u5982 C:\\\\mingw64&#xff09;&#xff0c;\u786e\u4fdd\u52fe\u9009 gcc-g&#043;&#043; \u7ec4\u4ef6\u3002<\/li>\n<li>\u914d\u7f6e\u73af\u5883\u53d8\u91cf&#xff1a;\n<ul>\n<li>\u6253\u5f00\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e&#xff08;Win &#043; S \u641c\u7d22\u201c\u73af\u5883\u53d8\u91cf\u201d&#xff09;\u3002<\/li>\n<li>\u5728 Path \u53d8\u91cf\u4e2d\u6dfb\u52a0 MinGW \u7684 bin \u76ee\u5f55\u8def\u5f84&#xff08;\u4f8b\u5982 C:\\\\mingw64\\\\bin&#xff09;\u3002<\/li>\n<li>\u4fdd\u5b58\u540e\u91cd\u542f Trae \u6216\u7ec8\u7aef\u4f7f\u914d\u7f6e\u751f\u6548\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>2. \u9a8c\u8bc1 MinGW \u5b89\u88c5<\/h4>\n<p>\u6253\u5f00\u7ec8\u7aef&#xff08;\u547d\u4ee4\u63d0\u793a\u7b26\u6216 PowerShell&#xff09;&#xff0c;\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p>g&#043;&#043; &#8211;version<\/p>\n<p>\u82e5\u663e\u793a\u7248\u672c\u4fe1\u606f&#xff08;\u5982 g&#043;&#043;.exe (MinGW-W64) 13.2.0&#xff09;&#xff0c;\u5219\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<hr \/>\n<h4>3. \u5728 Trae \u4e2d\u7f16\u8bd1\u8fd0\u884c C&#043;&#043; \u7a0b\u5e8f<\/h4>\n<h5>\u6b65\u9aa4 1&#xff1a;\u521b\u5efa\u5e76\u4fdd\u5b58 C&#043;&#043; \u6587\u4ef6<\/h5>\n<p>\u5728 Trae \u4e2d\u65b0\u5efa\u6587\u4ef6&#xff0c;\u8f93\u5165\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/p>\n<p>#include &lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main() {<br \/>\n    cout &lt;&lt; &#034;Hello, Trae!&#034; &lt;&lt; endl;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u4fdd\u5b58\u4e3a hello.cpp&#xff08;\u6ce8\u610f\u540e\u7f00\u540d&#xff09;\u3002<\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u4f7f\u7528\u7ec8\u7aef\u7f16\u8bd1<\/h5>\n<ul>\n<li>\u5728 Trae \u4e2d\u6253\u5f00\u7ec8\u7aef&#xff08;\u5feb\u6377\u952e &#096;Ctrl &#043; &#096;&#096; \u6216\u83dc\u5355\u680f\u6253\u5f00&#xff09;\u3002<\/li>\n<li>\u5bfc\u822a\u5230\u6587\u4ef6\u6240\u5728\u76ee\u5f55&#xff1a; cd path\/to\/your\/file\n<\/p>\n<\/li>\n<li>\u7f16\u8bd1\u4ee3\u7801&#xff1a; g&#043;&#043; hello.cpp -o hello.exe\n<\/p>\n<\/li>\n<li>\u8fd0\u884c\u7a0b\u5e8f&#xff1a; .\\\\hello.exe\n<\/p>\n<\/li>\n<\/ul>\n<p>\u7ec8\u7aef\u5c06\u8f93\u51fa&#xff1a;<\/p>\n<p>Hello, Trae!<\/p>\n<p> \u00a0<\/p>\n<hr \/>\n<h4>4. \u914d\u7f6e Trae \u7f16\u8bd1\u5feb\u6377\u952e&#xff08;\u53ef\u9009&#xff09;<\/h4>\n<p>\u5728 Trae \u8bbe\u7f6e\u4e2d\u6dfb\u52a0\u81ea\u5b9a\u4e49\u6784\u5efa\u4efb\u52a1&#xff1a;<\/p>\n<li>\u6253\u5f00\u8bbe\u7f6e&#xff08;Ctrl &#043; ,&#xff09;\u3002<\/li>\n<li>\u641c\u7d22 Tasks: Build&#xff0c;\u6dfb\u52a0\u65b0\u4efb\u52a1&#xff1a;<\/li>\n<p>{<br \/>\n    &#034;label&#034;: &#034;Build C&#043;&#043;&#034;,<br \/>\n    &#034;type&#034;: &#034;shell&#034;,<br \/>\n    &#034;command&#034;: &#034;g&#043;&#043;&#034;,<br \/>\n    &#034;args&#034;: [&#034;${file}&#034;, &#034;-o&#034;, &#034;${fileDirname}\/${fileBasenameNoExtension}.exe&#034;],<br \/>\n    &#034;group&#034;: &#034;build&#034;<br \/>\n}<\/p>\n<p>\u4fdd\u5b58\u540e&#xff0c;\u6309 Ctrl &#043; Shift &#043; B \u5373\u53ef\u4e00\u952e\u7f16\u8bd1\u5f53\u524d\u6587\u4ef6\u3002<\/p>\n<hr \/>\n<h4>\u5e38\u89c1\u95ee\u9898<\/h4>\n<ul>\n<li>g&#043;&#043; not found \u9519\u8bef&#xff1a;\u68c0\u67e5\u73af\u5883\u53d8\u91cf\u914d\u7f6e&#xff0c;\u786e\u4fdd Path \u4e2d\u5305\u542b MinGW \u7684 bin \u76ee\u5f55\u3002<\/li>\n<li>\u4e2d\u6587\u4e71\u7801&#xff1a;\u7f16\u8bd1\u65f6\u6dfb\u52a0 -fexec-charset&#061;GBK \u53c2\u6570&#xff1a; g&#043;&#043; hello.cpp -fexec-charset&#061;GBK -o hello.exe\n<\/p>\n<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u5373\u53ef\u5728 Trae \u4e2d\u5b8c\u6210 C&#043;&#043; \u7a0b\u5e8f\u7684\u7f16\u8bd1\u8fd0\u884c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u597d\u7684&#xff0c;\u4f7f\u7528 Trae \u7f16\u8bd1 C \u7a0b\u5e8f\u9700\u8981\u914d\u7f6e\u5916\u90e8\u5de5\u5177\u94fe&#xff08;\u5982 MinGW&#xff09;&#xff0c;\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4&#xff1a; 1. \u5b89\u88c5 MinGW<br \/>\n\u4e0b\u8f7d&#xff1a;\u524d\u5f80 MinGW-w64 \u5b98\u7f51 \u4e0b\u8f7d\u5b89\u88c5\u5305&#xff08;\u63a8\u8350\u9009\u62e9 x86_64-win32-seh \u7248\u672c&#xff09;\u3002\u5b89\u88c5&#xff1a;\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f&#xff0c;\u8bbe\u7f6e\u5b89\u88c5\u8def\u5f84&#xff08;\u5982 C:\\\\mingw64&#xff09;&#xff0c;\u786e\u4fdd\u52fe\u9009 gcc<\/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,99,190],"topic":[],"class_list":["post-66997","post","type-post","status-publish","format-standard","hentry","category-server","tag-c","tag-java","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565 - \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\/66997.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u597d\u7684&#xff0c;\u4f7f\u7528 Trae \u7f16\u8bd1 C \u7a0b\u5e8f\u9700\u8981\u914d\u7f6e\u5916\u90e8\u5de5\u5177\u94fe&#xff08;\u5982 MinGW&#xff09;&#xff0c;\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4&#xff1a; 1. \u5b89\u88c5 MinGW \u4e0b\u8f7d&#xff1a;\u524d\u5f80 MinGW-w64 \u5b98\u7f51 \u4e0b\u8f7d\u5b89\u88c5\u5305&#xff08;\u63a8\u8350\u9009\u62e9 x86_64-win32-seh \u7248\u672c&#xff09;\u3002\u5b89\u88c5&#xff1a;\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f&#xff0c;\u8bbe\u7f6e\u5b89\u88c5\u8def\u5f84&#xff08;\u5982 C:\\mingw64&#xff09;&#xff0c;\u786e\u4fdd\u52fe\u9009 gcc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/66997.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-27T15:41:20+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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/66997.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/66997.html\",\"name\":\"Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-27T15:41:20+00:00\",\"dateModified\":\"2026-01-27T15:41:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/66997.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/66997.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/66997.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565\"}]},{\"@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":"Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565 - \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\/66997.html","og_locale":"zh_CN","og_type":"article","og_title":"Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u597d\u7684&#xff0c;\u4f7f\u7528 Trae \u7f16\u8bd1 C \u7a0b\u5e8f\u9700\u8981\u914d\u7f6e\u5916\u90e8\u5de5\u5177\u94fe&#xff08;\u5982 MinGW&#xff09;&#xff0c;\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4&#xff1a; 1. \u5b89\u88c5 MinGW \u4e0b\u8f7d&#xff1a;\u524d\u5f80 MinGW-w64 \u5b98\u7f51 \u4e0b\u8f7d\u5b89\u88c5\u5305&#xff08;\u63a8\u8350\u9009\u62e9 x86_64-win32-seh \u7248\u672c&#xff09;\u3002\u5b89\u88c5&#xff1a;\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f&#xff0c;\u8bbe\u7f6e\u5b89\u88c5\u8def\u5f84&#xff08;\u5982 C:\\mingw64&#xff09;&#xff0c;\u786e\u4fdd\u52fe\u9009 gcc","og_url":"https:\/\/www.wsisp.com\/helps\/66997.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-27T15:41:20+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/66997.html","url":"https:\/\/www.wsisp.com\/helps\/66997.html","name":"Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-27T15:41:20+00:00","dateModified":"2026-01-27T15:41:20+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/66997.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/66997.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/66997.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Trae\u914d\u7f6eMinGW\u7f16\u8bd1C++\u5168\u653b\u7565"}]},{"@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\/66997","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=66997"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/66997\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=66997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=66997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=66997"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=66997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}