LNK1104 cannot open file 'kernel32.lib'

41 Views Asked by At

Getting following error LNK1104 cannot open file 'kernel32.lib', what path do i need to add, and where to add it in Visual Studio 2022.

I looked at previous threads, most solutions are for older versions of Visual Studio, can't find the configurations in newer version of Visual studio.

1

There are 1 best solutions below

1
Axel Kemper On

Make sure that you have installed the required Windows SDK. kernel32.lib is part of a Windows Kit.

Example path from my Windows 10 system:

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64\kernel32.Lib

Visual Studio configuration Project > Properties > VC++ Directories > Include Directories might be broken. Restore it to $(VC_IncludePath);$(WindowsSDK_IncludePath).