简体   繁体   English

无法用icpc打开源文件“bits / c ++ config.h”错误

[英]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.

相关问题 cgo编译错误:iostream:38:28:致命错误:bits / c ++ config.h:没有此类文件或目录 - Compiling error with cgo: iostream:38:28: fatal error: bits/c++config.h: No such file or directory Swig:找不到/bits/c++config.h或找不到包含 - Swig: either missing /bits/c++config.h or includes cannot be found g++ 4.6 版本号<bits/c++config.h>文件头 cstring 所要求的文件 - g++ 4.6 issue no <bits/c++config.h> file as required by the header cstring Windows上的Intel C ++编译器发生灾难性错误:无法打开源文件“ bits / unique_ptr.h” - Intel C++ compiler on Windows catastrophic error: cannot open source file “bits/unique_ptr.h” C++ 无法打开源文件“time.h” - C++ cannot open source file "time.h" IntelliSense:无法在C ++中打开源文件“curl.h” - IntelliSense: cannot open source file “curl.h” in C++ 灾难性错误:无法打开源文件“stdlib.h” - catastrophic error: cannot open source file "stdlib.h" 无法打开源文件 endian.h 错误——问题是什么? - Cannot open source file endian.h error – what is the problem? gtkmm.h 无法打开源文件(但编译时使用 pkg-config 标志) - gtkmm.h cannot open source file (but works with pkg-config flags when compiled) 无法打开源文件“ swap.h” - Cannot open source file “swap.h”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM