Mail Archives: djgpp/1997/03/05/15:18:18
Michael Rowley (stardog AT serv DOT net) wrote:
: Dazzling Dazz wrote:
: >
: > Can Someone please tell me what is wrong with the following program.
: > I try to compile it on djgpp but I get 'undeclared' or something error.
: > Maybe I don't have the right iostream.h file?
: I havent used that compiler yet BUT i think i know whats wrong, first of
: all, in most cmopilers main() defualts to int main(void) So by just
: having the line main() chances are your compiler reads it as int main
: (void) SO first off i would add the line return 0; to the end of your
: file.... Copy this code and try to compile it....first...
DJGPP is basically gcc, and doesn't mind this too much. The actual problem
is likely to be that the original poster is not linking in the C++ libraries;
either link the code using gxx instead of gcc, or add '-liostr' to the end of
the linking line, i.e.:
gxx test.cc
or
gcc test.cc -liostr
--
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.
- Raw text -