Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28865 Discussions

LINK: fatal error LNK1104: cannot open file 'kernel32.lib'

Ellis__Michael
Beginner
14,561 Views

Has anyone debugged this "kernel32.lib" issue with Intel Parallel Studio XE 2018 and Visual Studio 2017? This showed up in past posts for earlier software versions, but the suggestions do not seem to apply directly to the new versions. We just installed the Visual Studio extensions to get SDK's. Please let me know how to verify that we have installed enough through Visual Studio and how to get the Intel Fortran compiler to recognize these libraries from the command shell.

0 Kudos
3 Replies
Steve_Lionel
Honored Contributor III
14,562 Views

kernel32.lib is THE fundamental Windows API library. It is found in the Windows SDK and the default set of library locations should include it. But I have sometimes seen that separate installations of the Windows SDK messes up the environment variables Visual Studio uses to locate these.

The first thing I would suggest is, in Visual Studio, go to Tools > Options > Intel Compilers and Tools > Visual Fortran > Compilers. Click the Reset... button, then switch to the x64 tab and click the Reset... button there.  Go back to the Win32 tab, then click on the ... button to the right of Libraries. You should see a list that looks like this:

$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\lib\x86
$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\um\x86
$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x86
$(IFortInstallDir)compiler\lib\ia32_win
$(IFortInstallDir)mkl\lib\ia32_win
$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\atlmfc\lib\x86
$(WindowsSdkDir)lib\winv6.3\um\x86
$(FrameworkSDKDir)lib

If this doesn't help. find the latest folder containing kernel32.lib (on my system it is C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17134.0\um\x86 for Win32) and add that path explicitly at the end of the Libraries list. You really shouldn't have to do this, though.)

0 Kudos
Ellis__Michael
Beginner
14,562 Views

Thank you for the advice. My library list was nearly identical to yours. The fix to the problem seemed to be adding both the "um" library path and the "ucrt" library path. This allowed the linker to find all of the needed libraries.

Thank you!

0 Kudos
sihaqqi
Novice
7,362 Views

Hi,

I am trying to get past this issue. I have added the following paths. None seem to work. I havce added and removed SDK 10 and 11.

 

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x86

 

Please help

0 Kudos
Reply