Mail Archives: djgpp/2000/05/07/16:04:22
davidtmdu AT aol DOT com (Davidtmdu) wrote:
> I bought the book SAMS teach yourself c++ in 24 hours about a year ago - but in
> my opinion might as well be 24 years. As I am still trying to compile:
Some users have reported problems with the CD that comes with that
book. Those problems may now be fixed, but you should consider
downloading the latest version of DJGPP from http://www.delorie.com
> #include <iostream.h>
>
> int main()
> {
> cout << "Hello World!\n";
> return 0;
> }
>
>
> What am I doing wrong?
> I run windows 95 and use DJGPP.
You need to run a dos box under Windows. Look for the shortcut on the
start menu to MS-DOS Prompt and use that.
> I write all that stuff up there on notepad and save it as hello.cpp on c:\
Notepad is ok for emergencies but you will soon be tired of it, and it
has the problem of saving the file as hello.cpp.txt if you are not
careful. Download RHIDE or do a web search for a programmers editor.
> I go to RUN, and type:
> gxx <c:\hello.cpp> -o <hello.exe>
Type all the commands in the DOS box:
c:
cd \
gxx -Wall hello.cpp -o hello
> I'm pretty sure it's wrong, but what do to get it compiled to obj. file?
GCC produces .o files, but the above command compiles and links in one
go so there is no intermediate object file.
> By the way, this is the error message I get :
>
> gxx.exe: <c:\hello.cpp>: No such file or directory (ENOENT)
Check that hello.cpp does actually exist. Use the dir command for
this because Windows Explorer can hide file extensions and does not
always show filenames with the correct case.
Hope that helps,
Jason.
- Raw text -