Mail Archives: djgpp/1997/11/08/15:34:07
At 10:04 11/5/1997 +0100, Björn Landsberg wrote:
>Hi,
>Im just trying to get started with djgpp.
>But I get error messages when I try to compile a simple hello world c++
>program. That is when i've included iostream.h and try to use:
>cout << "bla bla...";
>
>I get the message "undefined reference to cout".
>If I use the -c option when I call gcc, wich skips the linking, I get no
>errors. I also tried -O wich I read somewhere.
>
>Whats wrong? Ive read the helpfiles and desperatley tried various
>combinations of different command-line arguments, without success.
Did you read README.1ST? It says that to link a C++ program, you have to
link the C++ libraries as well. A shortcut is to use `gxx' in place of
`gcc', which does this for you.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -