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:...." is not recognized as an internal or external command operable program or batch file.'
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
}
]
}
This works as I had intended:
{
"cmd": ["gcc", "$file_name", "-o", "${file_base_name}.exe", "&&", "start", "cmd", "/k" , "$file_base_name"],
"selector": "source.c",
"working_dir": "${file_path}",
"shell": true
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.