[Native] Why does gradle ignore value set for environment variable 'LIB' and 'LIBPATH'?


(Nico) #1

Hi all,

It seems like gradle is ignoring some value when I do a simple releaseStaticLibrary command. I would like to avoid to manually set these values in my build.gradle:

Ignoring value ‘C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/ATLMFC/LIB;C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/LIB;’ set for environment variable ‘LIBPATH’.
Ignoring value ‘C:/Program Files/Microsoft SDKs/Windows/v7.0/lib;C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/ATLMFC/LIB;C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/LIB;C:\PROGRAM FILES\DMEXPRESS\LIB’ set for environment variable ‘LIB’.

Is there any option to consider these value automatically ?

Thanks,


(Sam Stump) #2

I have the same. INCLUDE, LIB and LIBPATH are reported as being ignored.

G:\Development\bigint>gradle build
:compileMainExecutableMainCpp
Ignoring value ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;’ set for environment variable ‘INCLUDE’.
Ignoring value ‘C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;References\CommonConfiguration\Neutral;\Microsoft.VCLibs\14.0\References\CommonConfiguration\neutral;’ set for environment variable ‘LIBPATH’.
Ignoring value ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10150.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\lib\um\x64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;’ set for environment variable ‘LIB’.
bigint.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\crtdefs.h(10): fatal error C1083: Cannot open include file: ‘corecrt.h’: No such file or directory

:compileMainExecutableMainCpp FAILED

FAILURE: Build failed with an exception.


(David) #3

I noticed the same problem as @samstump and did some research.
Those environment variables are cleared on purpose since they have an influence on CL and LIB and LINK.
A locator is used to set these automatically for you in the compilation commands.

However, it seems VS 2015 is not fully supported in 2.12 since the C:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt path is not re-added automatically which contains the missing includes.

So I tried compiling again in a VS 2013 console and there the compilation fails due to missing C++14 support and not missing system includes.