Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error LNK1104: cannot open file 'gdi32.lib'

Every time I try to run my code I get this error. I've tried everything, installing the SDK, but I still get the same error.

1>------ Build started: Project: ConsoleApplication6, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'gdi32.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm using Windows 7 and Visual Studio 2012.

like image 773
JSK Avatar asked Sep 11 '25 09:09

JSK


1 Answers

If anyone has this problem on Visual Studio 2017, it is an issue with the Windows 10 Creators Update.

A workaround is to select the "Windows 10 SDK (10.0.15063.0) for Desktop C++ x86 and x64" under the "Desktop development with C++" workload in the Visual Studio Installer.

https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes#KINativeDesktopWorkload

like image 78
user7880029 Avatar answered Sep 13 '25 00:09

user7880029