Mail Archives: djgpp/2000/03/05/06:12:31
On Sun, 5 Mar 2000, caramaith wrote:
> e:/djgpp/lib/gcc-lib/djgpp/2.952/collect2.exe e:/djgpp/lib/crt0.o
> -Le:/djgpp/lib -Le:/djgpp/lib/gcc-lib/djgpp/2.952 -Le:/djgpp/bin
> -Le:/djgpp/lib e:/djgpp/tmp\ccapuWwM.o -lgcc -lc -lgcc -Tdjgpp.djl
> e:/djgpp/tmp\ccapuWwM.o(.text+0x84):cpplibtest.cpp: undefined reference
> to `Stash::initialize(int)'
The above command doesn't link in any C++ libraries. Are all the code
for the Stash class inside cpplibtest.cpp? If not, the linker complains
because you didn't tell it where to look for the definition of that class.
> e:/djgpp/tmp\ccapuWwM.o(.text+0x113):cpplibtest.cpp: undefined reference
> to `cout'
This is because you need to use gpp instead of gcc to link C++ programs.
It's in the FAQ.
- Raw text -