Answer the question
In order to leave comments, you need to log in
Sublime Text 3. Opening compiled .exe file in windows cmd?
Bottom line: I have already set up ST3 for C ++, already knows how to compile code and even displays the results in the editor console. But I want to make ST automatically open compiled .exe files on the command line (at least so that you can enter custom values.
My .sublime-build file:
{
"cmd": ["g++", "${file}", "-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": ["${file_path}/${file_base_name}.exe"]
}
]
}
Answer the question
In order to leave comments, you need to log in
In principle, the Run build system is correct, have you tried running the Run option yet?
This code works for me, I edited it myself by trial and error:
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,
"encoding": "1251",
"variants":
[
{
"name": "Run",
"shell": true,
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}", "&&",
"start", "${file_base_name}", "${file_path}/${file_base_name}"]
}
]
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question