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 就能夠了。

相關文章
相關標籤/搜索