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

青春壹個敷衍的年華 提交于 2019-12-22 03:40:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!