英特尔编译器使用错误的头 [英] Intel Compiler uses wrong header

查看:134
本文介绍了英特尔编译器使用错误的头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出为什么在安装了Visual Studio 2017之后安装的Intel Compiler 18.0使用的是MSVC的头文件,而不是它自己的头文件(因为它会导致错误).

I am trying to find out why the Intel Compiler 18.0, which got installed after my Visual Studio 2017 installation, uses the header files of MSVC, instead of it's own one (since it results in errors).

在Visual Studio中的C ++项目中编译时,简单的#include <vector>会以其他方式为空的翻译单元触发此错误

A simple #include <vector> triggers this error in an otherwise empty translation unit when compiled in a C++ project within Visual Studio

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\type_traits(1562): error : expected a ">"
1>      _INLINE_VAR constexpr bool _Is_specialization_v<_Template<_Types...>, _Template> = true;

可以肯定的是,为什么仍要使用MSVC包含项呢?重新安装没有导致任何更改.我根本不知道为什么会导致这个问题.有什么想法吗?

Just to be sure, why is it using the MSVC includes anyway? A reinstallation did not result in any change. I simply can't figure out, why it's causing this problem. Any ideas?

推荐答案

关于收到的错误消息:

About the error message you got:

我认为您遇到了类似的问题,例如此问题,在大多数情况下,此问题是由Intel Parallel Studio XE versionVS version之间的不兼容引起的.就像我在另一个线程中所建议的一样,您需要安装更高版本的Intel Parallel Studio XE版本才能解决此问题.

I think you're experiencing the same issue like this one, in most time this issue is caused by the incompatibility between Intel Parallel Studio XE version and VS version. Just like what I suggested in your another thread, you need to install the higher version of Intel Parallel Studio XE version to resolve the issue.

可以肯定的是,为什么仍要使用MSVC include?一种 重新安装没有导致任何变化.我简直不知道 出来,为什么会导致这个问题.有什么想法吗?

Just to be sure, why is it using the MSVC includes anyway? A reinstallation did not result in any change. I simply can't figure out, why it's causing this problem. Any ideas?

Intel C ++编译器对VS进行了扩展.您可以在Tools=>Extensions and Updates中对其进行检查:

Intel C++ Compiler works an extension for VS. You can check it in Tools=>Extensions and Updates:

同意 Adrian I don't think Intel would want to 'take ownership' of MFC.对于一个简单的C ++项目,如果我们将Intel C ++编译器设置为其编译器,那么到底会发生什么?让我们看一下项目文件(xx.vcxproj):

Agree with Adrian's I don't think Intel would want to 'take ownership' of MFC. For a simple C++ project, if we set Intel C++ compiler as its compiler, what would exactly happen behind? Let's see the project file(xx.vcxproj):

它设置<PlatformToolset>Intel C++ Compiler 19.0</PlatformToolset>,并可能对xx.vcxproj进行其他一些更改,但是该项目在其项目文件中仍然具有<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /><Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />之类的定义.

It sets the <PlatformToolset>Intel C++ Compiler 19.0</PlatformToolset>, and may do some other changes to the xx.vcxproj, but that project still have definitions like <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />, <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> in its project file.

因此,一些性能,有关MSVC的定义仍将在构建过程中导入.这就是为什么您收到的错误消息包含MSVC ...

So some peroperties, definitions about MSVC will still be imported during build process. That's why the error message you got contains MSVC...

注意:

  1. MSbuild 是VS的构建引擎,它读取xx.vcxproj的内容来编译和构建项目.

  1. MSbuild is the build engine of VS, it reads the content of xx.vcxproj to compile and build the project.

在导入的目标文件(如Microsoft.Cpp.Default.props$(VCTargetsPath)\Microsoft.Cpp.targets等)中定义了许多常规C ++构建过程的任务,属性和项目.

There're many tasks, properties, Items for normal C++ build process are defined in imported targets files like Microsoft.Cpp.Default.props,$(VCTargetsPath)\Microsoft.Cpp.targets and so on.

当我们right-click project=>Intel Compiler=>Use Intel C++时,它更改了platformToolSet设置,但仍将xx.cpp.targets作为构建过程的一部分导入.这样您就可以看到有关MSVC或构建输出中的错误消息.

When we right-click project=>Intel Compiler=>Use Intel C++ , it changed the platformToolSet setting, but it still import the xx.cpp.targets as part of build process. So you can see error message about MSVC or what in build output.

这篇关于英特尔编译器使用错误的头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆