g++ include problem...

Rob Wehrli plug-devel@lists.PLUG.phoenix.az.us
Sat Jul 14 09:18:01 2001


Kit Plummer wrote:
> 
> I know this is a retarded question, but I have scoured the Internet for
> the answer.
> 
> I am trying to compile a simple "hello world" with g++ and it errors
> with:
> 
> iostream.h : No such file found

I assume that you're using:

#include <iostream.h>


...in your source file?  Have you tried:

#include <iostream>


> 
> After searching for the file it IS located in the directory:
> 
> /usr/include/g++-3
> 
> I have tried to things to fix this:
> 
> export CPLUS_INCLUDE_PATH=/usr/include/g++-3
> 
> and
> 
> g++ hello.C -I /usr/include/g++-3 -o hello

...remember to "close the gap" in the above directive...

g++ -o hello -I/usr/include/g++-3/ hello.C


> 
> Neither cheat worked.
> 
> BTW: I am running a RH7.1 install.
> 
> Any ideas would be greatly appreciated.
> 
> - Kit
> 


Failing that:

// FILENAME: hello.C
using namespace std;
#include <iostream>
int main()
{
  cout << "Hello, World!\n" << endl;
  return 0;
}

Use this compiler invocation:

g++ -o hello hello.C 


...and if that doesn't work, reinstall gcc from your CD containing your
packages.

Take Care.

Rob!