Score:0

gcc: fatal error: no input files compilation terminated

ph flag

I'm new to linux environment. I created a file s1.c in a folder named 'program' which is present in desktop. When I try to compile my code using "/program gcc s1.c " it's showing "gcc: error: s1.c: No such file or directory gcc: fatal error: no input files compilation terminated." What may be the problem

FedKad avatar
cn flag
Change to "folder" `program`; make sure the file `s1.c` is in the current directory by running `ls`; then compile the program with `gcc s1.c`.
Score:0
cn flag

It seems like you are not in the same directory or you are not firing the command for program folder where s1.c file is located.

Make sure that you are running gcc s1.c while you are in program directory or you can try gcc program/s1.c if you are not in program directory.

You can refer this attached image for more info.

enter image description here

Score:-1
ru flag
$ cd ~/Desktop/program
$ gcc s1.c -o s1
$ ./s1
  • The first command changes in to the directory ~/Desktop/program.
  • The second compiles your C program s1.c1, the resulting executable is called s1.
  • The third command executes the executable called s1.
in flag
A little bit of context and detail will go a long way to explain why this so,union might work
ru flag
I don't understand what you're suggesting. Context? An explanation of what these commands do?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.