I want to build programs in the inbuilt build command of sublime text 2
I've made a gcc.sublime-build file with
{
"cmd" : ["gcc", "$file_name", "-o", "${file_base_name}"],
"selector" : "source.c",
"shell":true,
"working_dir" : "$file_path"
}
but all i get is an error saying
gcc: fatal error: no input files compilation terminated. [Finished in 0.0s with exit code 4]
any ideas
You can build/compile in Sublime Editor, but you can't run it on Sublime Editor. You can run it through terminal. Here is how we can do it. Open Sublime Editor, write a program and save it with .
Sublime Text is executing gcc
without parameters because "shell": true
means that the value of "cmd"
is passed to a shell, and it should be one string. In your file it appears that you want to pass parameters directly to GCC, so you should set "shell"
to false
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With