Mail Archives: djgpp/1997/02/08/15:11:19
daniel k rathjens wrote:
> [snip]
These instructions are correct, but there is something else wrong with
your program:
> : void main()
void main() is an illegal construct under C++. main() MUST return an
integer. Period. The compiler should give you a warning about this if
you compile with '-Wall'. It's also extremely bad practice in C.
What manual/teacher/person taught you to use 'void main()'?
> : C:\>gcc hello.cpp -o hello
This is an okay command line, but it's probably better to use the
following:
C:\>gxx -Wall -O -g -o hello.exe hello.cpp
Look up those various options in the gcc docs to see why they are so
useful.
Hope this helps!
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| "Starting flamewars since 1993" | http://www.cs.com/fighteer |
| *** NOTICE *** This .signature is generated randomly. |
| If you don't like it, sue my computer. |
---------------------------------------------------------------------
- Raw text -