{"id":1850,"date":"2026-10-13T21:35:08","date_gmt":"2026-10-13T13:35:08","guid":{"rendered":"https:\/\/blog.guguan.us.kg\/?p=1850"},"modified":"2026-10-13T23:33:32","modified_gmt":"2026-10-13T15:33:32","slug":"windows-%e5%ae%89%e8%a3%85-gcc","status":"publish","type":"post","link":"https:\/\/blog.guguan.us.kg\/?p=1850","title":{"rendered":"Windows \u5b89\u88c5 GCC"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6bcf\u6b21\u5728\u5b66\u6821\u7535\u8111\u4e0a\u90fd\u5fd8\u8bb0\u600e\u4e48\u4e0b\u8f7dGCC\uff0c\u5728\u8fd9\u91cc\u8bb0\u5f55\u4e00\u4e0b\u5b89\u88c5\u6d41\u7a0b<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u53d1\u884c\u4ed3\u5e93 <a href=\"https:\/\/github.com\/niXman\/mingw-builds-binaries\" target=\"_blank\" rel=\"noopener nofollow\">niXman\/mingw-builds-binaries<\/a> \u4e0b\u8f7d\u6700\u65b0\u7684 Release<\/p>\n\n\n\n<script type=\"module\" data-wp-block-html=\"js\">\nimport { Octokit } from \"https:\/\/esm.sh\/@octokit\/core\";\nasync function getMingwRelease() {\n\tconst CACHE_KEY = 'mingw_latest_release_cache';\n\tconst cachedData = localStorage.getItem(CACHE_KEY);\n\tif (cachedData) {\n\t\tconst { timestamp, data } = JSON.parse(cachedData);\n\t\t\/\/ \u68c0\u67e5\u7f13\u5b58\u662f\u5426\u5728\u6709\u6548\u671f\u5185\uff0824\u5c0f\u65f6\uff09\n\t\tif (Date.now() - timestamp < 24 * 60 * 60 * 1000) {\n\t\t\treturn data;\n\t\t}\n\t}\n\n\t\/\/ Octokit.js\n\t\/\/ https:\/\/github.com\/octokit\/core.js#readme\n\tconst octokit = new Octokit();\n\tconst response = await octokit.request('GET \/repos\/{owner}\/{repo}\/releases\/latest', {\n\t\towner: 'niXman',\n\t\trepo: 'mingw-builds-binaries',\n\t\theaders: { 'X-GitHub-Api-Version': '2026-03-10' }\n\t});\n\n\t\/\/ \u5199\u5165 localStorage\n\tlocalStorage.setItem(CACHE_KEY, JSON.stringify({\n\t\ttimestamp: Date.now(),\n\t\tdata: response.data\n\t}));\n\n\treturn response.data;\n}\n\nconst listContainer = document.getElementById('mingw-list');\ntry {\n\tconst releaseData = await getMingwRelease();\n\treleaseData.assets.forEach(item => {\n\t\tconst li = document.createElement('li');\n\t\tconst a = document.createElement('a');\n\t\ta.href = item.browser_download_url;\n\t\ta.textContent = item.name;\n\t\ta.target = '_blank';\n\t\ta.rel = 'noopener';\n\t\tconst highlightRegex = \/^x86_64-.*-release-win32-seh-ucrt-.*\\.7z$\/i;\n\t\t\/\/ \u68c0\u67e5\u662f\u5426\u5339\u914d\u76ee\u6807\u89c4\u5219\uff0c\u5982\u679c\u5339\u914d\u5c31\u7528 strong \u5305\u88f9\uff08\u6216\u8005\u52a0\u7c97\u4f53\u6837\u5f0f\uff09\n\t\tif (highlightRegex.test(item.name)) {\n\t\t\tconst strong = document.createElement('strong');\n\t\t\tstrong.appendChild(a);\n\t\t\tli.appendChild(strong);\n\t\t} else {\n\t\t\tli.appendChild(a);\n\t\t}\n\n\t\t\/\/ \u6587\u4ef6\u5927\u5c0f\uff08\u6362\u7b97\u6210 MB\uff09\n\t\tconst sizeMb = (item.size \/ (1024 * 1024)).toFixed(2);\n\t\tconst sizeSpan = document.createElement('span');\n\t\tsizeSpan.textContent = ` (${sizeMb} MB)`;\n\t\tsizeSpan.style.color = '#666';\n\t\tli.appendChild(sizeSpan);\n\n\t\tlistContainer.appendChild(li);\n\t});\n} catch (error) {\n\tlistContainer.innerHTML = `<li style=\"color: red;\">${error}<\/li>`;\n}\n<\/script>\n\n<ul id=\"mingw-list\"><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u538b\u5230 <code>%LOCALAPPDATA%\\Programs<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/s1.imagehub.cc\/images\/2026\/10\/13\/5d2bad73f2b45f5b4da4592d5a12e01b.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c06 <code>%LOCALAPPDATA%\\Programs\\mingw64\\bin<\/code> \u6dfb\u52a0\u8fdb\u7528\u6237\u73af\u5883\u53d8\u91cfPATH<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/s1.imagehub.cc\/images\/2026\/10\/13\/3c2ef7b9065bc3a1d381a1d256ecde13.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u9a8c\u8bc1\u5b89\u88c5 <code>gcc --version<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/s1.imagehub.cc\/images\/2026\/10\/13\/de4a9822ce90814ae5e89710f712f58d.png\" alt=\"\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u5982\u679cGitHub\u8bbf\u95ee\u901f\u5ea6\u7f13\u6162\uff0c\u53ef\u4ee5\u4ece\u7f51\u76d8\u4e0b\u8f7d<\/summary>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pan.lansod.cn\/s\/oxjcr\" target=\"_blank\" rel=\"noopener nofollow\">https:\/\/pan.lansod.cn\/s\/oxjcr<\/a><\/p>\n<\/details>\n","protected":false},"excerpt":{"rendered":"<p>\u6bcf\u6b21\u5728\u5b66\u6821\u7535\u8111\u4e0a\u90fd\u5fd8\u8bb0\u600e\u4e48\u4e0b\u8f7dGCC\uff0c\u5728\u8fd9\u91cc\u8bb0\u5f55\u4e00\u4e0b\u5b89\u88c5\u6d41\u7a0b \u4ece\u53d1\u884c\u4ed3\u5e93 niXman\/mingw-build [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1850","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=\/wp\/v2\/posts\/1850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1850"}],"version-history":[{"count":13,"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=\/wp\/v2\/posts\/1850\/revisions"}],"predecessor-version":[{"id":1866,"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=\/wp\/v2\/posts\/1850\/revisions\/1866"}],"wp:attachment":[{"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.guguan.us.kg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}