Mail Archives: djgpp/2004/01/14/10:31:35
Prior <prior AT surfeu DOT fi> wrote:
> I am newbie in DJGPP... so
>
> here is test.cc file
>
> #include <iostream.h>
>
> int main()
> {
> cout << "dsfdsf";
> return 0;
> }
>
> and I do: gcc -Wall -Wno-deprecated test.cc -o test.exe
[linker errors snipped]
> what is wrong? what should i do?
You should have used "gpp" rather than "gcc":
gpp -Wall -Wno-deprecated test.cc -o test.exe
Unlike gcc, gpp links in the C++ library. If you use "gcc" as your
command, you would have to list the c++ library explicitly, which you
didn't do. And since you didn't, the linker can't find cout, etc., so
it complains, leading to your error messages.
(And Hans-Bernhard Broeker is correct that you need to get yourself
and up-to-date C++ textbook. "iostream.h" has been deprecated (or, if
you're pedantic, simply nonstandard) since 1998. Code it right and
stop using "-Wno-deprecated." But that has nothing to do with the
linker error you got.)
Best regards,
Tom
- Raw text -