C++ errors

C++ users,

I am having some pretty basic problems with either my C++ libraries or C++ compilers. I first noticed the problem when I was trying to compile MPICH2, so I went back and tried to compile a very simple "Hello World!" program:

1
2
3
4
5
6
7
8
9
#include <iostream>

using namespace std;

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

But when I try compile this with the intel C++ compiler ("icc test.c++) I get this:

/usr/include/c++/3.4.6/iostream(44): catastrophic error: could not open source file "bits/c++config.h"
  #include <bits/c++config.h>
                             ^

compilation aborted for test.c++ (code 4)


Also I only get this error on the head node of our 20 node cluster. So if I ssh to any other node this program compiles just fine. When I try to compile with g++ (g++ test.c++) I get a whole mess of errors, most of it looks like this though:
In file included from test.c++:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream:44:28: bits/c++config.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios:44,
                 from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream:45,
                 from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream:45,
                 from test.c++:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd:46:29: bits/c++locale.h: No such file or directory
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd:47:25: bits/c++io.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios:46,
                 from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream:45,
                 from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream:45,
                 from test.c++:1:


Any suggestions on what might be the problem here. I thank you in advance for your help!




You seem to be picking up gcc C++ headers rather than those for the Intel compiler.
I picked up gcc headers when I tried to compile with g++ but I don't think that was the case when I compiled with icc. No?
Yes. Look at the paths.
Topic archived. No new replies allowed.