delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/28/08:55:48

Date: Tue, 28 Sep 1999 14:22:13 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Rodeo Red <rodeored AT netstep DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: hello.cpp: No such file or directory
In-Reply-To: <D9BC7976AAE40D84.C5602DF8447E0627.2CF1545D121CCB15@lp.airnews.net>
Message-ID: <Pine.SUN.3.91.990928141820.925B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019