Mail Archives: djgpp/1997/06/21/22:59:39
> anyway, on my pentium i've had a lot of problems. I tried compiling the
> 'hello' program in c & c++. no luck at first; the error message said that
> it didn't recognize the directive (#include). When I moved the #include
> from line 1 to line 3, the c program compiled.
Posting the exact error message and the original file would be helpful
here.
> After it recognized the include, I got these messages:
>
> c:/djgpp/tmp\ccdaaaaa(.text+0x12):test.cc: undefined reference to
> `endl(ostream&)'
> c:/djgpp/tmp\ccdaaaaa(.text+0x1c):test.cc: undefined reference to `cout'
> c:/djgpp/tmp\ccdaaaaa(.text+0x21):test.cc: undefined reference to
> `ostream::operator<<(char const *)'
> c:/djgpp/tmp\ccdaaaaa(.text+0x2c):test.cc: undefined reference to
> `ostream::operator<<(ostream &(*)(ostream &))'
>
> how can I correct this? As far as I know my djgpp.env is okay; this is
> what it looks like:
Well, you should either invoke gxx instead of gcc when compiling
c programs, or, manually specify the c++ libraries by doing
gcc file.c -lstdcx -liostrm
iostream may be mispelled, if you run gxx with -v option it will
show exact library name.
Andrew
- Raw text -