g++ include problems

Craig Howard craig.howard at shadnet.shad.ca
Mon Oct 22 09:41:12 PDT 2001


I'm using gcc-2.95.3 and have recently done something to screw up my 
header files.

#include <iostream>

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

when compiled with
$ g++ -o world world.cpp

produces
world.cc:1: iostream: No such file or directory

My header files are in /usr/include/g++  I've tried creating symlinks of 
/usr/include/g++-3 /usr/include/g++-include and reinstalling gcc, none 
of which have fixed the problem.  Note C programs compile fine, I was 
able recompile the kernel with no problems.

when compiled with
$ g++ -I/usr/include/g++ -o world world.cpp

produces:
/tmp/cc79sAta.o: In function `main':
/tmp/cc79sAta.o(.text+0xa): undefined reference to `endl(ostream &)'
/tmp/cc79sAta.o(.text+0x17): undefined reference to `cout'
/tmp/cc79sAta.o(.text+0x1c): undefined reference to 
`ostream::operator<<(char const *)'
/tmp/cc79sAta.o(.text+0x27): undefined reference to 
`ostream::operator<<(ostream &(*)(ostream &))'
collect2: ld returned 1 exit status

Any help would be _much_ appreciated.

Thanks


Craig Howard
craig.howard at shadnet.shad.ca

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list