簡體   English   中英

致命錯誤 LNK1104:無法在 Visual Studio 2019 中打開文件“kernel32.lib”

[英]fatal error LNK1104: cannot open file 'kernel32.lib' in Visual Studio 2019

我正在使用 Visual Studio 2019,即使我的 PATH 有 kernel32.lib 路徑,我也遇到了錯誤。

 C:\Users\googi\Desktop\CMakeProject2\out\build\x64-debug\CMakeProject2\LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
ninja: build stopped: subcommand failed.

小路...

c:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86

如果我嘗試在命令提示符下運行,它會說...

This file does not have an app associated with it for performing 
this action. Please install an app or, if one already installed,
create an association in the Defalt Apps Setting page.

我嘗試了其他這 3 條路徑,但它給了我完全相同的錯誤。

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm64
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64

關於您的情況,我建議您檢查以下內容:

  1. 檢查您是否為您的版本安裝了 Windows SDK。

  2. 檢查 $(WindowsSdkDir)\lib 是否包含在目錄列表中,如果沒有,請手動添加。

  3. 檢查 WindowsSdkDir 的值是否正確。

在此處輸入圖像描述

抱歉,我無法發表評論,但請打開您的互聯網連接並嘗試運行您的程序,該文件將自動下載。

它對我有用,也許它也對你有用

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM