avatar

Ebit

编程爱好者
欢迎交流!

全部文章总字数:434.8k


⣿⣿⣿⣿⣿⣿⡿⢛⠝⣠⡾⠋⠁⢀⣴⡶⣎⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣮⣭⣙⡻⠿⠋⣠⡞⠟⠃⠀⢀⡌⠻⢿⣿⣿
⣿⣿⣿⣿⣿⡿⠁⢀⣼⠟⠀⠀⣀⣽⣿⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡍⢀⣴⡏⠁⠀⠀⢠⣿⣿⣷⣦⡹⣿
⣿⣿⣿⣿⣿⢣⣄⠈⠁⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠾⠏⡇⠀⡄⣠⡿⣿⣿⣿⣿⣿⣾
⣿⣿⣿⣿⣏⣿⣿⡦⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠐⢿⣿⡼⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡟⣱⣿⣿⣿⣿⣿⣿⠃⣿⡿⣿⣿⣿⣿⣿⡟⠈⢿⣿⣿⣿⣿⢿⣻⣿⣿⣿⣿⡄⠀⠀⠀⠘⣮⣿⠝⢻⣿⣿⣿⣿
⣿⣿⣿⣿⣿⢏⣼⡿⣻⣿⣿⣿⣿⠃⢀⢹⡇⣿⣿⣿⣿⣿⣷⠀⡈⢻⣿⣿⣿⣎⢿⣏⢿⣿⣿⣷⡀⠀⠀⠀⠘⣿⡇⠘⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣞⡝⣴⣿⣿⣿⣿⠃⢠⣿⠸⡇⢹⣿⣿⣿⢻⣿⡀⣿⡌⢻⣿⣿⣿⡌⣿⡌⣿⣿⣿⣷⠀⠀⠀⠀⠈⠧⢠⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡿⣸⣿⣿⣿⣿⠇⢀⡛⣛⣇⢇⠈⣿⣿⣿⡎⣿⠁⢛⣛⡀⢛⡿⢿⣿⡘⣧⢹⣿⣿⣿⡇⢠⣄⡀⣠⠀⠈⢻⣿⣿⣿
⣿⣿⣿⣿⣿⢡⣿⣿⣿⣿⡏⢀⡟⣸⣿⣿⡌⠀⡸⣿⣿⣷⢸⠀⢸⣿⣿⣄⠻⣿⣿⣧⢹⢸⣿⣿⣿⣿⠸⡿⢰⣿⠀⢀⠻⣿⣿⣿
⣿⣿⣿⣿⡏⣾⣿⣿⣿⣿⠀⣾⠻⠿⠿⢿⣷⡀⢣⢻⣿⣿⡆⠀⢸⣯⡻⠿⣧⡘⢿⣿⣆⠀⣿⣿⣿⣿⡇⠀⠈⠉⠀⢸⡆⢸⣿⣿
⣿⣿⣿⣿⣁⣿⣿⣿⣿⡇⠘⠁⣠⡶⠂⠀⠙⣷⡈⢧⠹⣿⣇⢠⠈⠉⣠⣤⡄⠈⠙⠿⣿⡄⣿⣿⣿⣿⡇⠰⠖⠃⠀⢸⣷⠈⣿⣿
⣿⣿⣿⣼⣿⣿⣿⣿⣿⠀⢀⣾⣿⠟⠁⠀⠀⣿⣷⡀⣅⢹⣿⠘⡇⣿⣿⡿⠆⠀⠀⠀⠈⠃⠛⣿⣿⣿⡇⠀⠀⠀⠀⣿⣿⠀⣿⣿
⣿⣿⠟⣻⠿⣿⣿⣿⡟⠀⢸⣿⣿⡄⡄⠠⡀⣿⣿⣷⣜⣷⣬⣁⣿⣿⣿⠀⠀⡀⠀⠀⣧⢸⢡⣿⣿⡟⠁⠀⠀⠀⢰⣿⣿⡆⣿⣿
⣿⣿⣤⣿⠀⣿⣿⣿⡇⠀⠀⢿⣿⣷⣼⣯⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠻⠯⠟⣰⡟⠀⣾⣿⣿⡇⠀⠀⠀⠀⣿⣿⣿⡇⣿⣿
⣿⣿⣿⣿⡆⢹⣏⢿⡇⢠⣖⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⣼⣿⣿⣿⡇⠀⠀⠀⣠⣿⣿⣿⣧⣿⣿
⣿⣿⣿⣿⡱⠀⢿⡎⡡⠾⠿⢀⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⣡⢰⢃⣿⣿⣿⠁⠀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣷⣀⣄⢸⣿⣿⣭⣝⡊⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠂⣾⣿⣿⡟⢀⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⢿⣿⣿⣿⣿⣿⣿⢠⠙⢿⣿⣿⣿⣷⣬⡻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⡀⢸⣿⣿⢻⠇⠸⠃⠿⠿⠿⣿⣿⣿⣿⣿⣿
⢿⣿⣿⣿⣿⣿⡏⣸⠀⡇⠙⢿⣿⣿⣿⣿⣷⣍⠻⢿⣿⣿⣿⣿⣿⠿⢛⣭⡶⢋⣼⠇⣿⣿⡏⠀⠀⠀⣼⢛⣵⣾⣶⣮⡻⣿⣿⣿
⢸⣿⣿⣿⣿⣿⡇⣿⠀⠁⠀⡀⣍⠻⣿⣿⣿⣿⣧⣠⠙⠛⠋⢭⣶⡿⢟⣩⣶⣿⠟⣼⣿⠟⠀⠀⢀⣾⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡇⣿⠀⣤⡀⣷⡝⣰⣿⣿⣿⣿⣿⠏⠰⠿⠀⣨⣵⣾⣿⣿⠟⠁⣼⡿⢋⣀⣤⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡇⡿⣸⣿⣷⡟⣼⣿⣿⣿⣿⣿⡏⣠⣾⣿⡆⡸⣿⠿⣋⣵⢎⣚⣫⣴⣿⣿⡏⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡇⢠⣿⡿⢋⣾⣿⣿⣿⣿⣿⡟⢠⣿⣿⠏⡀⢧⠁⢺⣿⣿⣿⣿⡿⣻⣿⡟⣰⡿⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡇⣿⠏⠀⣿⣿⣿⣿⣿⣿⡟⠀⣼⡿⢁⢸⣧⣄⢀⡈⢿⣿⣿⣭⣾⣿⡟⣰⡿⣰⠇⣼⡄⣰⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⠘⠁⠆⠀⣿⣿⣿⣿⣿⡟⣰⡶⣿⢡⠏⢸⣿⠋⠚⣡⡈⣿⣿⣿⣿⠟⣱⣿⣇⠉⣴⠟⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿

2023-03-08T00:00:00.000Z

Vscode + C + Git(connected to github)

    1. install vscode
    1. sign in my account in vscode with my github account(probably need VPN)
    1. turn sync on and wait auto sync installing complete
    1. copy my MinGW folder below your C:
    1. open vscode and create a work folder(e.g. my-program)
    1. create a c file like hello.c, press <F5> to see if it can run and debug
    1. failed? don't be worry. Extensions will auto create folder .vscode to trying fix it. We just need to give it a helping hand:
    1. create .vscode\tasks.json including these:
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc.exe 建置使用中檔案",
            "command": "C:\\MinGW\\bin\\gcc.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "偵錯工具產生的工作。"
        }
    ],
    "version": "2.0.0"
}

and .vscode\lanuch.json:

{
    "configurations": [
        {
            "name": "C/C++: gcc.exe 建置及偵錯使用中的檔案",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "啟用 gdb 的美化顯示",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "將反組譯碼變體設為 Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: gcc.exe 建置使用中檔案"
        }
    ],
    "version": "2.0.0"
}

then it should run successfully now.

    1. [optional] sync with Git:
      1. install git(git for windows) / (suggest)github desktop
      1. sign up your github account
      1. create your repository in github-desktop.exe or website(need to link to git later)
      1. use your repository local folder as your work folder happily
      1. start

hope you have a nice programming environment

and thanks for reading^^