Mail Archives: djgpp/1998/03/09/23:31:01
Tim Faehnle wrote:
>
> C:\DJGPP\BIN\gcc -g -o test test.cc
> c:/djgpp/tmp\ccdaaaaa: In function 'main':
> test.cc:12: undefined reference to 'cout'
> test.cc:(.text+0x49): undefined reference to
> 'ostream::operator<<(double)'
>
> I would appreciate a response. Thank you very much.
If you study 'readme.1st' carefully, you'll see that you have to use a
different command line to compile C++ programs, because the linker
doesn't have any way to know that it needs to link the C++ libraries.
Specifically, add "-lgpp" to the end of your command line, or use 'gxx'
instead of 'gcc' which does this for you. You can use "-lstdcx" or
"-liostr" instead of "-lgpp" (for gcc 2.8.0, use "-lstdcxx"; "-liostr"
no longer exists).
The readme does need to be updated for gcc 2.8.0...
--
---------------------------------------------------------------------
| John M. Aldrich | "History does not record anywhere at |
| aka Fighteer I | any time a religion that has any |
| mailto:fighteer AT cs DOT com | rational basis." |
| http://www.cs.com/fighteer | - Lazarus Long |
---------------------------------------------------------------------
- Raw text -