• 在cmd窗口中执行

    tools->Build System->New Build System

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    {
    "cmd": ["g++", "${file}", "-fexec-charset=gbk", "-o", "${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",
    "variants":
    [
    {
    "name": "Run",
    "cmd": ["cmd", "/c", "g++", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & pause"]
    }
    ]
    }
  • 转换格式

    解决中文乱码

    ctrl+shift+p

    1. 安装ConvertToUTF8,

    2. ConvertToUTF8:Reload encoding with

    3. 选择Chinese Simplified(GBK)