Cannot open source file "bits/c++config.h" error with icpc
Asked Answered
O

2

12

I am trying to compile a program on a 64-bit machine with icpc. Unfortunately, I get an error message of catastrophic error: cannot open source file "bits/c++config.h". I have adopded some advice from here but with no success. Also, I do not forget to run source /opt/intel/bin/compilervars.sh intel64 before hand and I'm on Ubuntu 13.10 in case this is important.

Odious answered 29/10, 2013 at 14:3 Comment(0)
H
10

First, find the missing file:

find /usr -name c++config.h

(Headers are in /usr, most of the time.) Then, add its top dir to the include path of your compilation command, so the compiler will find "bits/c++config.h", using the -I option. A similar question was already asked on SO, BTW: Missing include "bits/c++config.h" when cross compiling 64 bit program on 32 bit in Ubuntu.

Halliard answered 29/10, 2013 at 14:21 Comment(1)
Thank you very much! I have seen the topic you suggest, though haven't found solution there. Anyway, your solution worked for me!Odious
P
10

For some reason the icpc compiler doesn't parse the following directory. You can set the following variable; replace 4.8 by your g++ version

export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/x86_64-linux-gnu/c++/4.8
Polymerism answered 22/4, 2014 at 12:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.