简体   繁体   English

ICC(14.0)甚至无法在Ubuntu 13.10中编译hello-world?

[英]ICC (14.0) cannot even compile hello-world in Ubuntu 13.10?

New to Linux, I just installed a Ubuntu 13.10 64 bit, with Eclipse 3.8 and intel's ICC 14.0. Linux新手,我刚刚安装了Ubuntu 13.10 64位,Eclipse 3.8和intel的ICC 14.0。

The GCC come with Ubuntu is version 4.8.1. GCC附带Ubuntu是4.8.1版本。

So far ICC installed cannot even compile hello-world in Eclipse due to it cannot compile iostream header. 到目前为止,ICC安装甚至无法在Eclipse中编译hello-world,因为它无法编译iostream头。

The iostream header will include another header, called c++config.h , stored in /usr/include/x86_64-linux-gnu/c++/4.8/bits iostream头将包含另一个头文件,名为c++config.h ,存储在/usr/include/x86_64-linux-gnu/c++/4.8/bits

The iostream header itself stored in /usr/include/c++/4.8 iostream标头本身存储在/usr/include/c++/4.8

The GCC compiler can compile the hello-world cpp and other c++ files perfectly, yet the ICC cannot even compile hello-world, tell me it cannot find c++config.h header, even if I include its path in the project. GCC编译器可以完美地编译hello-world cpp和其他c ++文件,但是ICC甚至无法编译hello-world,告诉我它找不到c++config.h头文件,即使我在项目中包含它的路径。

Anyone know any work-around for this? 有人知道任何解决方法吗?

You can: 您可以:

  1. Add system include on command line 在命令行上添加系统包括

    icc -idirafter /usr/include/x86_64-linux-gnu/c++/4.8/ -I... -L... my.cpp icc -idirafter /usr/include/x86_64-linux-gnu/c++/4.8/ -I ... -L ... my.cpp

  2. Permanently add it to icc.cfg 永久地将其添加到icc.cfg

    cat /opt/intel/composer_xe_2013_sp1.1.106/bin/intel64/icc.cfg cat /opt/intel/composer_xe_2013_sp1.1.106/bin/intel64/icc.cfg

    -idirafter /usr/include/x86_64-linux-gnu/c++/4.8/ -idirafter /usr/include/x86_64-linux-gnu/c++/4.8/

I successfully used this to compile scipy. 我成功地用它来编译scipy。

Two possibilities exist without changing too much of your setup: 在不改变太多设置的情况下存在两种可能性:

  1. Install an older version of GCC alongside the default one, assuming that ICC will work with some version, just maybe not the very new one you have now. 假设ICC可以使用某个版本,可能不是您现在拥有的新版本,而是安装旧版本的GCC和默认版本。
  2. Install a newer version of ICC. 安装较新版本的ICC。 It looks like you may already have the latest, but perhaps there is a patch release. 看起来您可能已经拥有最新版本,但也许有一个补丁版本。 I somewhat doubt it though. 我有点怀疑它。

This kind of thing happens fairly often when mixing and matching different compilers and standard libraries. 在混合和匹配不同的编译器和标准库时,这种事情经常发生。 It helps if both are of roughly the same age. 如果两者的年龄大致相同,则会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM