public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: not finding header files...
       [not found] <616BE6A276E3714788D2AC35C40CD18D763077@whale.softwire.co.uk>
@ 2002-08-07  9:54 ` Rupert Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Rupert Wood @ 2002-08-07  9:54 UTC (permalink / raw)
  To: jun; +Cc: gcc-help

Jun Goo wrote:

> i've just finished installing a copy of gcc 3.1.1 onto my computer
> and instead of replacing 2.96 (the previously installed version of
> gcc), i installed 3.1.1 under /usr/local (actual g++, gcj, g77, etc 
> files under /usr/local/bin)
:
> i believe the header files for 3.1.1 are under 
> /usr/include/g++-3

They're probably under /usr/local/include/g++-3.

The best way to debug this sort of thing is to compile something simple,
e.g. your hello.cc, with the -v switch:

    g++ -v hello.cc

GCC will, amongst other things, dump its search directory path to the
console so you can see where it's looking.

Good luck,
Rup.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* not finding header files...
@ 2002-08-07  9:34 Jun Goo
  0 siblings, 0 replies; 2+ messages in thread
From: Jun Goo @ 2002-08-07  9:34 UTC (permalink / raw)
  To: gcc-help

dear gnu gurus,

i've just finished installing a copy of gcc 3.1.1 onto my computer and 
instead of replacing 2.96 (the previously installed version of gcc), i 
installed 3.1.1 under /usr/local (actual g++, gcj, g77, etc files under 
/usr/local/bin)

my problem is that although i can still compile files fine with the 2.96 
version (i.e. g++), i'm having problems when i try to compile with the 3.1.1 
version

for example, when i tried compiling the following (hello.cc):

#include <iostream>
using namespace std;

int main() {
  cout << "Hello World!" << endl;
  return 0;
}

with: g++ hello.cc

it still compiled fine when i used the 2.96 version but i got the following 
with 3.1.1:

hello.cc:1:20: iostream: No such file or directory
hello.cc: In function `int main()':
hello.cc:5: `cout' undeclared (first use this function)
hello.cc:5: (Each undeclared identifier is reported only once for each 
function
   it appears in.)
hello.cc:5: `endl' undeclared (first use this function)

i believe the header files for 3.1.1 are under /usr/include/g++-3 whereas 
for 2.96, they are under/usr/include/g++-2

so basically, my question is, is it possible for me to set up or reconfigure 
gcc 3.1.1 so that it correctly finds the necessary header files without my 
having to pass a flag/set of flags everytime? and if i am forced to pass a 
set of flags pointing to where the header files are, could someone tell me 
what they are?

i'm fairly new to linux so please forgive me if this problem is really 
trivial and thanks in advance for any help.

in case it's helpful, my computer is loaded up with the redhat 7.3 linux 
distribution and i didn't have any noticeable problems after running the gcc 
testsuite prior to installation.

-jun

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-07 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <616BE6A276E3714788D2AC35C40CD18D763077@whale.softwire.co.uk>
2002-08-07  9:54 ` not finding header files Rupert Wood
2002-08-07  9:34 Jun Goo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).