你如何使用 Sublime Text 3 配置 MinGW? [英] How do you configure MinGW with Sublime Text 3?

查看:64
本文介绍了你如何使用 Sublime Text 3 配置 MinGW?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了 MinGW,我一直试图让它与 Sublime Text 3 一起工作,以便在编译脚本时打开 cmd,但没有任何效果.

I recently installed MinGW and I've been trying to get it to work with Sublime Text 3 to get it to open cmd when when I compile the script, however nothing works.

当我转到工具>构建系统>新构建系统并保存此脚本时,我不断收到错误消息:

When I go to Tools > Build System > New Build System and save this script, I keep on getting an error:

'"C:...." 不被识别为内部或外部命令可运行的程序或批处理文件.'

'"C:...." is not recognized as an internal or external command operable program or batch file.'

出于某种原因,从未创建可执行文件.你如何让这个工作?我在 C:\MinGW\bin

For some reason, the executable is never created. How do you get this to work? I have gcc in C:\MinGW\bin

{
"cmd": ["gcc", "${file}", "-o", "${file_base_name}.exe"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,

"variants":
[
    {
        "name": "Run",
        "cmd": ["start", "cmd", "/k", "${file_path}/${file_base_name}.exe"],
        "shell": true
    }
]
}

推荐答案

这符合我的预期:

{
"cmd": ["gcc", "$file_name", "-o", "${file_base_name}.exe", "&&", "start", "cmd", "/k" , "$file_base_name"],
"selector": "source.c",
"working_dir": "${file_path}",
"shell": true
}

这篇关于你如何使用 Sublime Text 3 配置 MinGW?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆