2

I need to compile a VC++ VS2015 project I'm working on as a binary compatible with Windows 7. I'm using Win10 and VS2015 with v140 compiler.

As specified in this page I set the target platform to 8.1 and modified the targetver.h such as this:

#include <WinSDKVer.h>

#define WINVER 0x0601
#define _WIN32_WINNT 0x0601 

#include <SDKDDKVer.h>

Obviously, it compiles correctly, but when I execute the binary on a windows 7 pc, it gives me "Missing shcore.dll", which, from what I gather is a dll available only from Windows 8.1 onwards and makes me think that I've done something wrong or there's something I'm missing.

fedexist
  • 155
  • 2
  • 12
  • Did you try to define **WINVER** and **_WIN32_WINNT** before the `#include ` ? Is WinSDKVer.h inclusion still useful? – Jeandey Boris Jan 14 '17 at 17:33
  • Just tried, unfortunately no use. I included `WinSDKVer.h` as it was specified inside targetver.h itself, autogenerated by VS. In particular, It reads that "if you want to compile the application for a previous windows platform, include `WinSDKVer.h` and set the **_WIN32_WINNT** macro on the platform to be supported before including `SDKDDKVer.h`" – fedexist Jan 14 '17 at 18:02
  • http://stackoverflow.com/questions/17023419/win-7-64-bit-dll-problems – RbMm Jan 14 '17 at 19:12
  • @RbMm is it really the same issue? The binary is a graphic/opengl application and I'm already distributing it with its dependencies (glew, sdl, libpng, zlib etc.). Shcore.dll is, as a matter of fact, only available from windows 8 and onwards and **that** is the actual issue at hand: the binary execution should not even need that dll. – fedexist Jan 14 '17 at 19:30
  • how your PE is bind to `Shcore.dll`? - you import/ call some api from it ? doubt. faster of all `CRT` which you use somehow bind to `shcore.dll` - which kind of CRT you use ? – RbMm Jan 14 '17 at 19:52
  • I'm using ucrt. From what I gather, ucrt should be compatible with Windows version before 10, given the needed Windows updates, but as far as I can see this machine is fully updated. I'll try to dig up some more and see if it's really the case. – fedexist Jan 14 '17 at 20:51

2 Answers2

2

I just had the same error on Win7 and unfortunately the DLL is not available for Windows 7. Just on Windows 8.1 and higher.

shcore.dll on Windows 7 -- does it exist?

Hope that Helps!

Community
  • 1
  • 1
Kevin
  • 21
  • 2
1

I got this error too while launching a WPF app on Windows 7. The good news is the error is trapped and handled internally, you can probably just ignore the exception and let the program run. Worked for me.

Zyo
  • 1,934
  • 21
  • 25