Cannot open source file “bits/c++config.h” error w

2019-04-21 02:32发布

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.

2条回答
劳资没心,怎么记你
2楼-- · 2019-04-21 03:15

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
查看更多
SAY GOODBYE
3楼-- · 2019-04-21 03:19

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.

查看更多
登录 后发表回答