VS的 X64下的匯編編譯


參考博客 VS編譯64位匯編時報錯:error C4235: 使用了非標准擴展: 不支持在此結構上使用“_asm”關鍵字 

 

在用VS2013編譯內聯匯編時,報如下錯誤:

錯誤    5    error C4235: 使用了非標准擴展: 不支持在此結構上使用“__asm”關鍵字

百度之后才知道原來VS在X64下不支持內聯匯編了。

網上有多種方法解決這個問題,這里是參考的博客 VS編譯64位匯編時報錯:error C4235: 使用了非標准擴展: 不支持在此結構上使用“_asm”關鍵字 

首先安裝Intel C++ Compiler XE。 下載Intel C++ Compiler XE,官網上不知道怎么下載,從一個百度網盤上下載下來的。這里自己又做了一個分享,文件有點大,2.8G 。    https://pan.baidu.com/s/1skU5Jjf

安裝過程中要關閉 VS。

安裝完之后參照上述博客,把平台工具集改為  Intel C++ Compiler XE 15.0

image

然后編譯項目,我這里接着又報了另外一個錯

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 supported

然后去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 就可以了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM