YW Chang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    3
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 安裝 Mingw-w64 教學 Download and install Mingw-w64 on Win10 tutorials ##### tags:`c/c++` ## 關於MinGW - [維基百科](https://zh.wikipedia.org/wiki/MinGW) - [MinGW 與 MinGW-w64 差別](https://stackoverflow.com/questions/25582110/what-is-the-difference-between-mingw-mingw-w64-and-mingw-builds) ## 下載 MinGW-w64 安裝執行檔 1. 進入[官方網站 Officical Website](http://mingw-w64.org) 2. 進入網站後,頁面大概如下,點選<font color="#f00">**紅框**</font>。 ![](https://i.imgur.com/l9HK7M7.png) 3. 首先會看到 **"Pre-built toolchains and package"** 的表格,這裡是包含MinGW-w64及特定工具整合包。本教程只專注於安裝MinGW-w64,所以僅下載MinGW-w64即可。找到 **"Souces"** 標題,並點選<font color="#f00">**紅框**</font>。 ![](https://i.imgur.com/hF4OLZ1.png) 4. 進入SourceForge頁面後,會看到很多檔案,這邊如果沒有特殊需求的話,直接點擊<font color="#000cd">**藍框**</font>後,找到 **"MinGW-W64 Online Installer"** 點擊<font color="#f00">**紅框**</font>,或直接下拉頁面找到<font color="#f00">**紅框**</font>部分。 ![](https://i.imgur.com/YRhk1pn.png) 5. 在等待5秒鐘後,該執行檔就會自動下載至本機端。 ## 安裝MinGW-w64 :::warning :warning: 若出現執行檔不能執行的錯誤,也可以直接下載對應的壓縮檔 `x86_64-win32-seh`,解壓縮後即可使用。 ::: 6. 在本機端找到該執行檔 **"mingw-w64-install.exe"**。開啟後下一步到以下畫面。筆者設定如下,接著點選<font color="#f00">**紅框**</font>。 ![](https://i.imgur.com/rRhL5oi.png) >Version: gcc版本。沒有特殊需求,一般選擇最新版本號。 >Architecture: 電腦系統架構。 >>1. 64位元: x86_64 >>2. 32位元: i686 >> >Threads: 這邊筆者比較沒概念。可[參考](https://stackoverflow.com/questions/17242516/mingw-w64-threads-posix-vs-win32)大神的解釋。 >Exception:異常處理模型。 >>1. seh性能較優,但不支援32位元。 >>2. sjlj效能較差,支援32位元和64位元。 >> >Build version: 這邊沒得選,維持默認。 7. 接下來可更改安裝位置<font color="#000cd">**藍框**</font>。筆者這邊選擇默認位置(稍微記下這個位置,後面會用到),點選<font color="#f00">**紅框**</font>。 ![](https://i.imgur.com/IkngRyf.png) 8. 這邊就讓它進行自動安裝流程。這邊會根據網路速度而定,筆者實測大約5分鐘。 ![](https://i.imgur.com/gI6xpSC.png) 9. 這樣就安裝完成啦:smile:! ![](https://i.imgur.com/BftrHq3.png) ## 設定環境變數 10. 到剛剛的安裝目錄,會看到以下的檔案,點選<font color="#f00">**紅框**</font>。 ![](https://i.imgur.com/uUw8d3U.png) 11. 再次點選<font color="#f00">**紅框**</font>。 ![](https://i.imgur.com/X50A7So.png) 12. 在這個資料夾內存放許多的執行檔。如<font color="#228b22">**綠框**</font>部分,gcc.exe是編譯C語言,g++.exe是編譯C++,而gdb.exe是偵錯(debug)時的工具。點擊<font color="#f00">**紅框**</font>,並複製<font color="#000cd">**藍色文字**</font>。 ![](https://i.imgur.com/3EDyqQh.png) 13. 於左下角 **"開始"** 右鍵,點選 **"系統"**。 ![](https://i.imgur.com/TtxkPMC.jpg) 14. 進入畫面後點選右側 **"進階系統設定"**(即<font color="#f00">**紅框**</font>部分)。 ![](https://i.imgur.com/rBJWX3R.png) 15. 再點擊<font color="#f00">**紅框**</font>。 ![](https://i.imgur.com/bhBjh4F.png) 16. 接著找到 **"Path"** 並點擊,再按 **"編輯"**。註:如果想要讓此電腦的所有使用者皆可使用,則更改 **"系統變數"** (即下方選單),步驟相同。 ![](https://i.imgur.com/CaqZcng.png) 17. 點選 **"新增"**,再將剛剛複製的路徑貼上,最後按下 **"確定"** 就完成了。 ![](https://i.imgur.com/nGdUyCJ.png) ## 安裝與環境變數設定完成 - 可透過在 **"命令提示字元"** (搜尋cmd)輸入以下指令,如有成功輸出版本資訊,就是安裝成功啦:grinning:! ``` gcc -v g++ -v ``` 示意圖如下 ![](https://i.imgur.com/XOn6cJF.png) ## Vscode 中使用 C/C++ 可以參考專案[VSCode_template_for_c_cpp](https://github.com/YW0330/VSCode_template_for_c_cpp)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully