Sublime Forum

G++: no such file or directory; g++: fatal error: no input files

#1

Dear folks,

pls be so kind to support me concerning my problem:

I’m not able to compile any file in sublime text, all packages are installed. With every other program Eclipse, DevC++, Codeblocks, it’s possible to compile and link the files. But not with sublime.

Also tried any instruction I was able to find: deinstall/reinstall, build in files, etc. nothing worked.

Thanks in advance and kind regards,
Gerhard

0 Likes

#2

The error message no input files means exactly that; you executed the compiler, but you didn’t tell it what to compile.

If you look at your error output, the shell_cmd line tells you what command Sublime executed. You can see in there that it executed gcc "" -o "/" && "/". As we can see, there’s no filename there. In fact the places where the "" are indicate the places where the variable that expands out to the current file name exist.

In addition, the tab with your code in it is showing the first line of the file, which is an indication that you haven’t saved the file. Build systems execute external tools, and external tools have no way to know what content you might be working on; they can only tell what you’re working on if you save the file first.

Taken all together, the very first thing you need to do after creating new content and before trying to build it is save it to disk somewhere.

0 Likes

#3

Thanks a million! Worked immediately as it should!

Have a nice day,
KR, G

1 Like