Mail Archives: djgpp/1997/11/13/06:47:43
On Wed, 12 Nov 1997, Daniel Gowans wrote:
> I cannot get it to work. It will NOT load the header files.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is incorrect analysis. Your gcc -v trace says something else:
> c:\djgpp\bin\ld.exe -o prog2.exe c:\djgpp\lib\crt0.o -Lc:\djgpp\lib
> c:\djgpp\tmp\ccdaaaaa -lm -Tdjgpp.djl -lgcc -lc -lgcc
> c:\djgpp\tmp\ccdaaaaa(.text+0x323):prog2.cc: undefined reference to
> `ifstream::ifstream(int)'
> c:\djgpp\tmp\ccdaaaaa(.text+0x33a):prog2.cc: undefined reference to
> `cout'
It cannot find necessary *libraries*, not header files. The linker
doesn't give a damn about headers.
The reason is that you didn't follow the advice of README.1ST and the
FAQ: when linking C++ programs, use gxx instead of gcc. gxx instructs
the linker to scan the C++ class libraries.
> #include <...> search starts here:
> c:\djgpp\lang\cxx
> c:\djgpp\include
> c:\djgpp\contrib\grx20\include
Did you edit your DJGPP.ENV file? If not, these paths should have been
printed with forward slashes. If you did edit DJGPP.ENV, please revert
it to its stock version (you might have trouble with some DJGPP programs
otherwise).
- Raw text -