[英]Cannot open source file “bits/c++config.h” error with icpc
I am trying to compile a program on a 64-bit machine with icpc. 我正在尝试使用icpc在64位机器上编译程序。 Unfortunately, I get an error message of
catastrophic error: cannot open source file "bits/c++config.h"
. 不幸的是,我收到了
catastrophic error: cannot open source file "bits/c++config.h"
的错误消息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. 另外,我不会忘记在运行之前运行
source /opt/intel/bin/compilervars.sh intel64
并且我在Ubuntu 13.10上,以防这很重要。
For some reason the icpc compiler doesn't parse the following directory. 由于某种原因,icpc编译器不解析以下目录。 You can set the following variable;
您可以设置以下变量; replace 4.8 by your g++ version
用你的g ++版本替换4.8
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/x86_64-linux-gnu/c++/4.8
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. (大部分时间都是/ usr中的标题。)然后,将其顶部dir添加到编译命令的include路径中,这样编译器将使用-I选项找到“bits / c ++ config.h”。 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 .
在SO,BTW上已经提出了类似的问题: 在Ubuntu中在32位上交叉编译64位程序时 , 缺少包括“bits / c ++ config.h” 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.