问题
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.
回答1:
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.
回答2:
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
来源:https://stackoverflow.com/questions/19660431/cannot-open-source-file-bits-cconfig-h-error-with-icpc