Answer the question
In order to leave comments, you need to log in
How to set up C compilation in Sublime text under Linux?
Hello,
I wrote a helloworld, I press Tools -> Build and I get
/bin/bash: g++ : command not found
[Finished in 0.0s with exit code 127]
[shell_cmd: g++ "/home/e/code/1.c" -o "/home/e/code/1"]
[ dir: /home/e/code]
[path: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin :/usr/games:/usr/local/games]
Answer the question
In order to leave comments, you need to log in
Sublime builds c files out of the box using g++, i.e. your helloworld is written in c++.
To use the c compiler:
Tools > Build system > New build system...
{
"cmd" : ["gcc", "$file_name", "-o", "${file_base_name}", "-lm", "-Wall"],
"selector" : "source.c",
"shell":false,
"working_dir" : "$file_path"
}
g++: command not found - it is written after all) There is no compiler in the system. Install gcc
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question