From: "Johan Venter" Newsgroups: comp.os.msdos.djgpp References: <37f09d7a DOT 0 AT news DOT uni-bielefeld DOT de> <4444922EAD9F4DF3 DOT F0655FD613956B47 DOT 417327D971FC01B7 AT lp DOT airnews DOT net> Subject: Re: hello.cpp: No such file or directory Lines: 71 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Date: Wed, 29 Sep 1999 15:40:52 +1000 NNTP-Posting-Host: 139.134.163.142 X-Trace: newsfeeds.bigpond.com 938597791 139.134.163.142 (Wed, 29 Sep 1999 19:36:31 EST) NNTP-Posting-Date: Wed, 29 Sep 1999 19:36:31 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Rodeo Red wrote in message news:4444922EAD9F4DF3.F0655FD613956B47.41732> > Well I really thought I had- I have that file in every concievable directory by now. But after I got your message i saved > it again to a new directory and that seems to have worked. Thanks for the help. Here is an example (saying you are in C:\ and your source file is in C:\SOURCE): C:\> cd source C:\SOURCE>gcc test.c -o test.exe That will create test.exe from the test.c source file. You need to be in the directory your program is in to compile it. If you want to use rhide, you need to go to the directory your source is in and type rhide at the DOS prompt. GCC is a command line driven compiler. > 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 ? > The faq mentions something about "no exe " but its talking about novel programs which I do not have, so it doesn't seem to > apply. Compiling and Linking are two seperate stages of the compilation process. Compiling takes the source files and construct from them "object files". A project can have several object files. The next stage is called linking. Linking consists of taking your now-created object files, linking them together (thus the name), and creating an executable file. Please read the README.1ST file that comes with your DJGPP distribution. It contains important information that you need to learn. > Hello.o appears in the windows directory, I suppose because I started rhide from the window prompt. I can't seem to make > C:\myprograms\hello> > > I tried compliling without rhide and got : > > 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::o > erator<<(char const *)' > > C:\WINDOWS> > What in the world does this mean ? I don't see any reference to this in the faq This is because are trying to compile a C++ program without linking the C++ libraries. > 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> > > How do I do that ? cd \myprograms\hello It's a shame that the world of Windows has completely obsoleted the need for the computer user to learn at least some basic DOS commands. Maybe you should get a book on how to use DOS (note, DOS, not Windows). -- Johan Venter ICQ 3643877 - jventer AT writeme DOT com The TPU DJGPP Interest Group - http://surf.to/djgppig The RSXNTDJ 1.5 HOWTO - http://surf.to/rsxntdj