Mail Archives: djgpp/1999/10/08/16:58:30
On Fri, 08 Oct 1999 11:12:16 -0500, emal72 <emal72 AT gateway DOT net> wrote:
>I am a total novice. I got "teach yourself C++ in 24 hrs book. the
>directions are limited, for me. What I did. I installed the prog, I
>checked the memory, I went to the ride text editor, typed in my short
>silly little program ( hello. exe) clicked save went to a ms dos prompt
>got the message " no such file or dir" Tried compiling it got error
>messages a go-go line...undefined checked my code for mistakes.
>according to the book there are none so my queston is what am I doing
>wrong? I find this stuff interresting but if I can't jump this hurdle
>then I can't learn C++ which will frustrate me to no end so please help
>me. thanks
Hi ?
Have you set up your paths and environmet variables and the DJGPP.ENV
file (if you're using DJGPP). This is all in the documentation.
You might also like to consider getting the latest version of DJGPP,
if that's what you're using from
http://www.delorie.com/djgpp/
Lots of info and help and documentation here.
when you start RHIDE, if you are creating a new file, save your file
as soon as you've created it with the right extension. for C files,
use hello.c, for C++ files, use hello.cpp or hello.cc, (there are
others in use for C++ files). If you save your file with the right
extension, RHIDE will recognise it as a source file and you will then
get syntax colouring.
Having typed your program in in RHIDE, you then need to compile and
link it. to produce the executable.
To do this I just press F9
then (When you've fixed any errors) you can run it. I usualy press
Ctrl and F9
If your program runs and then exits back to RHIDE immediately, and you
dont get a chance to see what happened, then pressing
Alt and F5 will show you the user screen.
It is very important to read ALL the documentation that comes with
RHIDE and DJGPP (If that's what you're using.)
This is the usual starting point: -
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return(0);
}
If you type this in using RHIDE (Don't forget the semicolons and dont
use ANY cApiTaLs appart from in between the quotes.) and call it
hello.c, then if it compiles and links and runs, your half way to
getting your compiler working.
If this won't compile, then you've probably got an
installation/configuration problem which will be resolved following
carefull perusal of the documentation.
Kevin.
- Raw text -