Could not locate library 'libucrt.lib'


(Paul van Oppen) #1

Gradle Version: 3.0
Operating System: Windows 7
Is this a regression? If yes, which version of Gradle do you know it last worked for? no (AFAIK)

We try to use the cpp toolchain:

apply plugin: 'cpp'
model {
	components {
	demoBuildApp(NativeExecutableSpec) {
			sources {
					cpp {
						source {
								srcDir "src"
								include "**/*.cpp"

The source is a simply one file, containing :

int main(int ac, char** av)
{  return ac; 

When running gradle build --info we got:

compile part OK
Successfully started process 'command ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\link.exe’'
LINK : fatal error LNK1104: cannot open file ‘libucrt.lib’

Looking in the linker generated options.txt, I see:"/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86"
However the libucrt.lib is not in that directory…

We are using version 14 Update 3 of Visual Studio and it is a known fact that those libraries have been moving around a bit, and are now at C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt under 4 platform dependent subdirectories (arm, arm64, x64 and x86). The same structure exist under C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10150.0\ucrt as well.