www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/13/06:47:43

Date: Thu, 13 Nov 1997 13:46:28 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Daniel Gowans <daniel DOT gowans AT m DOT cc DOT utah DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: cannot load header files
In-Reply-To: <346A9A5B.A3B61F5C@m.cc.utah.edu>
Message-ID: <Pine.SUN.3.91.971113134113.23653H-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019