Mail Archives: djgpp/1998/07/20/01:45:30
>#include<iostream.h>
>int main()
>{
>cout << "hello world";
>return 0;
>}
use "gcc file.cc -o file.exe -lstdcxx".
jorge ivan meza martinez
http://members.xoom.com/THP
jimeza AT usa DOT net
-----Original Message-----
De: DreamerZ <dreamerz AT jps DOT net>
Para: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
Fecha: Domingo 19 de Julio de 1998 02:09 AM
Asunto: Help
>Okay, I've got DJGPP setup ok, I think. The environment variables are all
>set and stuff. I'm just now trying to get everything to work correctly.
>Here's what I'm trying to do:
>
>The quick and easy hello.cpp:
>
>
>When I compile the program like that, I get:
>
> e:/djgpp/tmp\cccay4ve(.text+0x15):hello.cpp: undefined reference to `cout'
> e:/djgpp/tmp\cccay4ve(.text+0x1a):hello.cpp: undefined reference to
>`ostream::op
> erator<<(char const *)'
>
>The only iostream.h file I have is in e:\djgpp\lang\cxx\ (I've included
>it). That Iostream.h includes another file (streambuf.h) which I did not
>include.
>
>The cout command was the one I was taught for output.
>
>If I write the program like:
>
>#include<stdio.h>
>int main()
>{
>printf("Hello World");
>exit(0);
>}
>
> it works fine.
>
>That, I'm assuming is C (I haven't learned that).
>
>HELP! What am I doing wrong? Is it in the program or what?
>
>Thx,
>
>Chad
>
- Raw text -