Date: Wed, 29 Sep 1999 10:28:55 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Rodeo Red cc: djgpp AT delorie DOT com Subject: Re: hello.cpp: No such file or directory In-Reply-To: <4444922EAD9F4DF3.F0655FD613956B47.417327D971FC01B7@lp.airnews.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 28 Sep 1999, Rodeo Red wrote: > I compiled in RHIDE and it said there were no errors, but it made a > program called hello.o when I thought it would make hello.exe. What > is going on here ? That's because you compiled instead of compile-and-link. The former produces an object file, the latter produces an executable program. > C:\WINDOWS>gcc hello.cpp -o hello.exe -lm > c:/djgpp/tmp\cccimbbe(.text+0x19):hello.cpp: undefined reference to `cout' > c:/djgpp/tmp\cccimbbe(.text+0x1e):hello.cpp: undefined reference to `ostream::operator<<(char const *)' > > C:\WINDOWS> > What in the world does this mean ? It means some of the library functions called by your programs wasn't found by the linker. > I don't see any reference to this in the faq I think section 8.7 explains this: you need to use gxx or gpp insteadd of gcc to link C++ programs. > Again, the reason it says C:\WINDOWS> is that I can't controll the > prompt very well. If I write prompt it gives me C:\> but I wish I > could make it go C:\myprograms\hello> The prompt shows the current working directory. To change to another directory, use the CD command, like this: cd c:\myprograms If the directory C:\myprograms doesn't exist, you will need to create it first: mkdir c:\myprograms