I'm trying to use the Windows release of Swift so that I can develop and build into executables.
I have followed the official "get started" docs and two online tutorials that all leave me with the same errors.
I triple checked all the Visual Studio requirements. I execute these 4 lines in x64 native command prompt:
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"
Then in the project directory I execute these two commands:
set SDKROOT=%SystemDrive%/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk set SWIFTFLAGS=-sdk %SDKROOT% -resource-dir %SDKROOT%\usr\lib\swift -I %SDKROOT%\usr\lib\swift -L %SDKROOT%\usr\lib\swift\windows
And last I try to build into an executable, which is when I get the errors in the screenshot.
Swift is installed (
swift --version returns what is expected).
The error I'm getting says that SwftShims can't be built because the file
stddef.h is not found. But the file is there. Apparently this same error gets thrown on certain version of Ubuntu, but I'm not sure how to fix this. I posted a log below where I tried to execute
swift main.swift. I know this isn't supported yet, but it gives me the same errors as when I try to build, but in a much more readable format.
Any help is much appreciated.