1. 程式人生 > >VS2017編譯C++ Project,報error LNK1104

VS2017編譯C++ Project,報error LNK1104

  最近工作上需要開發Windows驅動程式,於是安裝了vs2017 15.9.4以及最新版的WDK10。安裝完成後開發編譯驅動程式都正常,可是回頭編譯以前的c++程式時,報錯“LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'”。開始嘗試使用vs2017 installer進行修復,但是修復後仍無法編譯c++ Project。於是網上查詢資料。在微軟的Developer Community裡找到一篇帖子“https://developercommunity.visualstudio.com/content/problem/383447/cannot-open-file-msvcrtdlib.html

”,官方技術人員提示需要安裝libs for spectre(X86 and X64),這個元件在安裝vs2017時預設不安裝的。開啟vs2017 installer,在單個元件tab中找到libs for spectre(X86 and X64),如下圖:

安裝完成以後,再次編譯c++ Project,編譯通過。