Mail Archives: djgpp/1999/09/28/08:55:48
On Tue, 28 Sep 1999, Rodeo Red wrote:
> C:\WINDOWS\Desktop>gcc hello.cpp -o hello.exe -lm
> gcc.exe: hello.cpp: No such file or directory (ENOENT)
>
> The file does exist.
In what directory does hello.cpp exist? The prompt above indicates that
you invoked gcc in the C:\WINDOWS\Desktop directory. Does hello.cpp live
in that directory? If not, you need to invoke gcc in the directory where
hello.cpp lives.
> #2)Also does it matter which directory should I save hello.cpp to ?
It's up to you. Just invoke the compiler from the same directory where
the source files are.
> How does the program know where ot look ?
It looks in the same directory where you invoke the compiler, and ONLY in
that directory.
> #3) Why else would I get this message ?
Some editors attach extensions to file names: you might type "hello.cpp"
when you save the file, but the editor creates e.g. "hello.cpp.txt".
Use the DIR command to see what files are there.
- Raw text -