gcc no such file help me please!!

January 20, 2011 at 01:47:35
Specs: Windows 7
i try to compile c language

#include <stdio.h>

int main()
printf("Goodbye, cruel world!\n")

i write this with note pad and i save it with the name goodbye.c and i save it on my desktop

then i compile it with cygwin command: '$ gcc goodbye.c -o goodbye' but it show

gcc: goodbye.c : no such file or directory
gcc: no input files

help me please!!!!
thank you

See More: gcc no such file help me please!!

Report •

January 20, 2011 at 02:34:27
Where are you running gcc from?

If not in the same directory as your source file, how is gcc going to know where it is?

Life is too important to be taken seriously.


Report •

January 20, 2011 at 04:28:04
i run gcc from C:\cygwin

Report •

January 20, 2011 at 04:34:28
so how should i do?should i save it at any specific file?

Report •

Related Solutions

January 20, 2011 at 16:04:05
You should try running gcc from the directory/folder where goodbye.c is. Mechanix is right. How is gcc going to find it?

Are you opening up a cygwin window or a command prompt in windows?

I am not a cygwin guy, but I doubt a command prompt would work.

Report •

January 21, 2011 at 04:15:02
i open up a cygwin window, and i still dont understand,should i put the goodbye.c to C:\cygwin ? i already copy a file to there but that nothing happen

Report •

January 21, 2011 at 08:27:54
Apparently, your current directory is not being searched. I have two suggestions:

1) Assuming goodbye.c is in your current directory, try this:

gcc ./goodbye.c -o goodbye

2) change your PATH variable to search your current directory:


Report •

January 23, 2011 at 01:35:19
erm,how to see where is my directory?i am a computer newbie,so sorry about asking too much...

Report •

January 23, 2011 at 08:24:48
From within your cygwin window, type:


it wil tell you what your present working directory is.

Report •

July 29, 2011 at 02:03:25
Hello, i'm french.
so my english is not so good. can you excuse me.
I'have the same problem than you but ican't find any solution.
Can you gime me somme indication.
Bill Gates.

Report •

July 29, 2011 at 02:15:16
i come again, i find a solution.
i tip $cmd and tip "dir" and i realise
than the file extension is myfile.c.txt
Therefore, i tip gcc myfile.c.txt -o myfile.exe
and the result is file not reconized.
maybe i have to specifie myfile.c and no more else

Report •

July 29, 2011 at 02:18:21
i try to save myfile without extension and
tip gcc myfile.txt -o myfile but it doesn't match.

Report •

July 29, 2011 at 02:29:42
Ok, i have just find my problem.
i edited myfile with notepad and it append
with *.txt so bugggggg.
So for the another newbie.
can tip:

Pour les frenchies editer avec un editeur qui ne met pas d'extention
par default.

Report •

Ask Question