not finding header files...

Jun Goo jun_goo@hotmail.com
Wed Aug 7 09:34:00 GMT 2002


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



More information about the Gcc-help mailing list