Sublime Forum

Please help me for the c build

#1

what should i do?
I’m a new learner for c language.
plz

0 Likes

#2

The diagnostic output of your build shows that the command it’s trying to execute is gcc -o , while the build system itself shows that cmd includes the base name of the current file as well as the full filename.

Thus, the basis of your problem is that you didn’t save your source file before you tried to build it. If the file isn’t saved, it doesn’t have a name, and without a name Sublime can’t provide the name to the external tool, and without the name the external tool (in this case gcc) can’t see the content of your file.

As a side note, if you’re going to compile and run single file C programs and you’re going to use gcc to do it, the built in C Single File build already has the ability to do this. The way your build is defined, you need to use one command to compile the program and then a second one to run it; the C Single File build can compile and run in one step, which might save you some time.

0 Likes