Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowsSdkLocator doesn't detect Windows SDK 10 #929

Closed
lacasseio opened this issue Nov 25, 2016 · 6 comments
Closed

WindowsSdkLocator doesn't detect Windows SDK 10 #929

lacasseio opened this issue Nov 25, 2016 · 6 comments
Assignees
Labels
a:bug affects-version:3.3 in:native-platform c, cpp, swift and other native languages support, etc
Milestone

Comments

@lacasseio
Copy link
Contributor

Expected Behavior

Gradle should detect and use the Windows SDK 10 if installed or directly pass as a candidate.

Current Behavior

Gradle doesn't detect and use Windows SDK 10. On a clean machine (possibly only Windows 10) with a fresh install of Visual Studio 2015, Gradle fail to build any application that requires access to the Windows SDK (for example kernel32).

Context

This is a bit tricky to solve as with Windows SDK 10, Microsoft started versioning the include and lib in relation to move toward the Universal C Runtime.

Steps to Reproduce (for bugs)

On a fresh Windows 10 machine with only Visual Studio 2015 install try to build CUnit sample.

@lacasseio
Copy link
Contributor Author

The current workaround is to either:

  1. Install older version of the Windows SDK (for example 8.1)
  2. Enter the include path and library path manually as compiler and linker args

Option 1 may have side effect and undefined behavior regarding breaking changes made the Windows API between 8.1 and 10 or missing feature as you will be targeting Windows 8.1 feature set.

@lacasseio lacasseio added a:bug affects-version:3.3 from:member in:native-platform c, cpp, swift and other native languages support, etc labels Nov 25, 2016
@zosrothko
Copy link
Contributor

This could be fixed by making WindowsSdkLocator working in the same way as DefaultUrctLocator and abstracting both to a common WindowsLocator.

@pedrolamarao
Copy link

I've just hit the same bug.
This is what I get when running gradle with --debug:

13:23:37.595 [DEBUG] [org.gradle.nativeplatform.toolchain.internal.msvcpp.DefaultWindowsSdkLocator] Ignoring candidate Windows SDK directory C:\Program Files (x86)\Windows Kits\10 as it does not look like a Windows SDK installation.
13:23:37.596 [DEBUG] [org.gradle.nativeplatform.toolchain.internal.msvcpp.DefaultWindowsSdkLocator] Could not find Windows resource compiler in system path.
13:23:37.596 [DEBUG] [org.gradle.nativeplatform.toolchain.internal.msvcpp.DefaultUcrtLocator] Found ucrt 10.0.10240.0 at C:\Program Files (x86)\Windows Kits\10
13:23:37.597 [DEBUG] [org.gradle.nativeplatform.toolchain.internal.msvcpp.DefaultUcrtLocator] Found ucrt 10.0.10240.0 at C:\Program Files (x86)\Windows Kits\10

@eriwen
Copy link
Contributor

eriwen commented Aug 28, 2017

@lacasseio @eljobe can this be moved to gradle-native?

@prb28
Copy link

prb28 commented Feb 15, 2018

This may help someone (workaround 1 from @lacasseio) :
with gradle 4.5.1, installing VC++ 2015.3 v140 toolset (x86,x64) did work.
vctools
(Image borrowed from https://stackoverflow.com/questions/44046355/visual-studio-2015-not-detecting-v141-2017-build-tools)

@adammurdoch adammurdoch self-assigned this Feb 17, 2018
@adammurdoch adammurdoch added this to the 4.7 RC1 milestone Feb 17, 2018
@adammurdoch
Copy link
Member

This is fixed in #4414. I'm going to close this issue. Please open a new issue if you run into any further problems with Visual Studio or Windows SDK discovery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug affects-version:3.3 in:native-platform c, cpp, swift and other native languages support, etc
Projects
None yet
Development

No branches or pull requests

6 participants