I successfully created my own Python 3.8 compiler in sublime, which works like a charm. Now i installed MinGW64 on my windows 10 machine. Which is working, i can use “gcc --version” and “g++ --version” in cmd (so PATH is working).
I saw this post about setting up c/c++ compiler in sublime: https://www.thecrazyprogrammer.com/2017/04/how-to-run-c-and-c-program-in-sublime-text.html
{
"shell_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",
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
}
]
}
#include <iostream>
int main() {
std::cout << "Hello World!";
return 0;
}
{
"shell_cmd" : "gcc $file_name -o ${file_base_name}",
"working_dir" : "$file_path",
"variants":
[
{
"name": "Run",
"shell_cmd": "gcc $file_name -o ${file_base_name} && ${file_path}/${file_base_name}"
}
]
}
#include<stdio.h>
int main() {
printf("Hello World\n");
return 0;
}
But both compilers only says:
[Finished in 1.1s]
with no “Hello World” output. I used the correct (basically my own) build systems.