VS的 X64下的汇编编译

参考博客 VS编译64位汇编时报错:error C4235: 使用了非标准扩展: 不支持在此结构上使用“_asm”关键字 app

 

在用VS2013编译内联汇编时,报以下错误:工具

错误    5    error C4235: 使用了非标准扩展: 不支持在此结构上使用“__asm”关键字flex

百度以后才知道原来VS在X64下不支持内联汇编了。网站

网上有多种方法解决这个问题,这里是参考的博客 VS编译64位汇编时报错:error C4235: 使用了非标准扩展: 不支持在此结构上使用“_asm”关键字 .net

首先安装Intel C++ Compiler XE。 下载Intel C++ Compiler XE,官网上不知道怎么下载,从一个百度网盘上下载下来的。这里本身又作了一个分享,文件有点大,2.8G 。    https://pan.baidu.com/s/1skU5Jjfcode

安装过程当中要关闭 VS。orm

安装完以后参照上述博客,把平台工具集改成  Intel C++ Compiler XE 15.0blog

image

而后编译项目,我这里接着又报了另一个错get

error #10310: Failed to enable trusted storage check for licensing: WARNING: Enable Trusted Storage failed (flexnet error code 20). Trusted Storage based license could not be supportedinput

而后去intel网站 https://software.intel.com/en-us/articles/error-trusted-storage-check 查到以下:

image

拷贝下来方便之后再次遇到:

Workaround for Windows* users:
Run Intel compiler as administrator once.
Steps:
1. Go to Start menu -> All Programs -> Intel® Parallel Studio XE -> Compiler and Performance Libraries -> Command Prompt with Intel Compiler.  Choose an appropriate command prompt.
2. In the command prompt window, run command:

runas /user:administrator "icl /v"

or

runas /user:administrator "ifort /v"

You will be prompted to input administrator’s password. This step will trigger the compiler to install the Windows service “FLEXnet Licensing Service 64”.

运行出来以下图:

image

运行的时候遇到输入密码不能为空的错误,须要为administrator设置一个密码,而后就能够成功了。

再编译就能够正常编译了。

image

这里编译的是一个lib文件,test工程引用这个lib,编译test的时候遇到了  “没法打开libmmd.dll” 的问题,这时候只须要把test的平台工具集也修改成Intel C++ Compiler XE 15.0 就能够了。

相关文章
相关标签/搜索