Automatic detection of Visual Studio Community 2015 RC not working properly

I have installed Visual Studio Community 2015 RC in it’s default location. Gradle seems to pick up the location through the registry [1], but the compilation fails because standard headers (e.g. stdio.h) are not found.

When I manually specify the installDir

toolChains {
  visualCpp(VisualCpp) {
    installDir "C:/Program Files(x86)/Microsoft Visual Studio 14.0"
  }
}

it works fine. The INCLUDEs seem to be not detected properly for automatic detection.

I’m using the latest stable release of Gradle (2.4).

[1] ([DEBUG] [org.gradle.nativeplatform.toolchain.internal.msvcpp.DefaultVisualStudioLocator] Found Visual C++ 14.0 at C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC)

Thanks! I’ve raised GRADLE-3313 We’ll need to expand our test matrix to include VS 2015.

Could you post your options.txt for compiling and linking with and without the installPath specified?

I tried it again on a clean example (the native-binaries/c sample from the gradle distribution) and found that manually specifying the installDir for VS 2015 doesn’t solve the problem. I must have messed up the paths in my first attempt.

Anyway, VS 2015 support is broken. Some headers (e.g. stdio.h) are no longer present in ${installDir}/include. They have moved to directory C:/Program Files (x86)/Windows Kits/10/Include/10.0.10056.0/ucrt/, which is not picked up by gradle.

There is a blog post that describes the changes for VS2015: http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx

options.txt:

/TC
/nologo
/c
/DDLL_EXPORT
/Zi
/Zi
/IE:\gradle-2.4\samples\native-binaries\c\src\hello\headers
"/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include"
"/IC:\Program Files (x86)\Windows Kits\8.1\Include\shared"
"/IC:\Program Files (x86)\Windows Kits\8.1\Include\um"

Is there an idea of when we can expect PR 704 to be merged and GRADLE-3313 to be resolved?

As far as I understand it, Microsoft introduced the breaking UCRT changes in March 2015, and they’ve already announced breaking changes for the next version - Compiler Tools Layout in Visual Studio “15”, should we expect a similar delay in support for that too?

We’re working around the UCRT issues at the moment while using VS2015 (short of building from source with the mentioned PR), but I’m concerned that the changes in the next version won’t be as easy to work around.

Regards,

Phil

Hi Phil,

Thanks for voicing your concern over this. We are actively priotizing this feature as well as considering a faster feedback loop for newer toolchain.

Regards,

Daniel

Thanks for getting back to me Daniel. That’s all I needed to know :slight_smile:

Phil

Hi

There is already a PR solving this issue on Windows with VS2015: #704: https://github.com/gradle/gradle/pull/704
except it seems to break the Linux build with gcc… I am wokring on this now

Hey any news on this?

Hi Alex,

I’m currently assigned to work on this PR/limitation in Gradle. You can follow the work done on this Github issue.

Thanks for your patience,

Daniel

The issue tha was breaking gcc compiling on Linux has been fixed and the fixes are commited on the PR#704… You can apply this PR locally in case of urgency waiting for the definitive solution from @Daniel_L