Sublime Forum

How can I fix this issue with Compiling C++?

#1

Im not sure how to set up sublime text.

g++: error: : No such file or directory
g++: fatal error: no input files
compilation terminated.

0 Likes

#2

What’s the full diagnostic output look like?

This sort of thing happens when you create a new tab and put some code in it, but don’t formally save it once in order to give it a name on disk before you try to build.

As a result there’s no file on disk, the build system doesn’t know what the name of the file is (because there is not one) and Sublime tries to run g++ without telling it what file to compile (because it doesn’t know) which causes the compiler to get mad at you because it expects you to tell it what to compile.

So all else being equal, File > Save and make sure your file has a name.

0 Likes