tensorflow / swift

Swift for TensorFlow
https://tensorflow.org/swift
Apache License 2.0
6.12k stars 608 forks source link

<unknown>:0: error: unable to load standard library for target 'x86_64-unknown-windows-msvc' #431

Closed AbhimanyuAryan closed 4 years ago

AbhimanyuAryan commented 4 years ago

I'm using Windows 10 2004. I have downloaded everything for Visual Studio 2019. I already had Visual Studio 2017 but since 2019 was recommended so I went with downloading it separately

I installed CMake 3.17.1 on Windows & it worked. Checked Command-Line after that

I then followed the steps of copy-pasting

set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
copy "%SDKROOT%\usr\share\ucrt.modulemap" "%UniversalCRTSdkDir%\Include\%UCRTVersion%\ucrt\module.modulemap"
copy "%SDKROOT%\usr\share\visualc.modulemap" "%VCToolsInstallDir%\include\module.modulemap"
copy "%SDKROOT%\usr\share\visualc.apinotes" "%VCToolsInstallDir%\include\visualc.apinotes"
copy "%SDKROOT%\usr\share\winsdk.modulemap" "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap"

everything in 2019 cmd visual studio tools....whatever mentioned using admin permissions but I get this error when I compiled my swift code

<unknown>:0: error: unable to load standard library for target 'x86_64-unknown-windows-msvc'

Can anyone suggest to me what went wrong?

AbhimanyuAryan commented 4 years ago

compiling works like this

set SDKROOT=%SystemDrive%/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk
swiftc -sdk %SDKROOT% -I %SDKROOT%\usr\lib\swift -L %SDKROOT%\usr\lib\swift\windows -emit-executable test.swift -o test.exe
steverichey commented 3 years ago

Thanks for sharing your solution, I had the same problem!

Marimuthu-T commented 3 years ago

I'm using Windows 10 2004. I have downloaded everything for Visual Studio 2019. I already had Visual Studio 2017 but since 2019 was recommended so I went with downloading it separately

I installed CMake 3.17.1 on Windows & it worked. Checked Command-Line after that

I then followed the steps of copy-pasting

set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
copy "%SDKROOT%\usr\share\ucrt.modulemap" "%UniversalCRTSdkDir%\Include\%UCRTVersion%\ucrt\module.modulemap"
copy "%SDKROOT%\usr\share\visualc.modulemap" "%VCToolsInstallDir%\include\module.modulemap"
copy "%SDKROOT%\usr\share\visualc.apinotes" "%VCToolsInstallDir%\include\visualc.apinotes"
copy "%SDKROOT%\usr\share\winsdk.modulemap" "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap"

everything in 2019 cmd visual studio tools....whatever mentioned using admin permissions but I get this error when I compiled my swift code

<unknown>:0: error: unable to load standard library for target 'x86_64-unknown-windows-msvc'

Can anyone suggest to me what went wrong?

@AbhimanyuAryan Me too getting the same error can you help out with what you do to get rid out of it.