Reputation: 534
I am trying to run c programs in sublime 2, windows machine, I have installed mingw, updated the path variable, and copied the following code in the sublime new build system
{
"cmd": ["gcc -o $file_base_name $file && ./$file_base_name"],
"path": "C:/Program Files (x86)/CodeBlocks/MinGW/bin",
"shell": true
}
Then i wrote a simple C program
#include<stdio.h>
int main()
{
printf("ihdfoihsdifhoisdhf");
return 0;
}
On pressing CTRL+SHIFT+b and CTRL+b , i am getting the following error
'.' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.4s with exit code 1]
Upvotes: 0
Views: 1226
Reputation: 2012
The problem is most likely here:
"cmd": ["gcc -o $file_base_name $file && ./$file_base_name"],
The dot-slash is current-directory notation for *nix systems, but you're on a Windows system, so try changing that to
"cmd": ["gcc -o $file_base_name $file && $file_base_name"],
Likewise, you will want to change the forward-slashes /
in your path
to backslashes \
.
Upvotes: 1