Mail Archives: djgpp/1997/12/28/11:35:00
D Hacker wrote:
>
> Hi!
> I am lerning c++ but I have a big problem.
> When I tried to compil the simple file below (inledn.cpp) I got this
> message:
> d:/djgpp/tmp\ccdaaaaa(.text+0x16):inledn.cc: undefined reference to `cout'
> d:/djgpp/tmp\ccdaaaaa(.text+0x1b):inledn.cc: undefined reference to
> `ostream::op
> erator<<(char const *)'
This means you failed to link the C++ libraries. Add "-lgpp" to the end
of your command line, or use 'gxx' instead of 'gcc' to compile C++
programs.
> I run djgpp in DOS, and to compill i use the commando: gcc inledn.cpp (i
> have tried -o but gcc dosent't know that comman).
'-o' is used to tell gcc what file to output. Try "gcc -o inledn.exe
inledn.cpp -lgpp".
BTW, this stuff is covered in 'readme.1st' and the FAQ (v2/faq210b.zip
or online at http://www.delorie.com/djgpp/v2faq/).
hth
--
---------------------------------------------------------------------
| John M. Aldrich | "Waking a person unnecessarily |
| aka Fighteer I | should not be considered a capital |
| mailto:fighteer AT cs DOT com | crime. For a first offense, that |
| http://www.cs.com/fighteer | is." - Lazarus Long |
---------------------------------------------------------------------
- Raw text -