You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
please convert these instructions to be platform based, perhaps using the On macOS/On Linux/On Windows technique used elsewhere on the page. Then in the Windows section, replace the swiftc command with the following:
The "ls" command should also be replaced with the "dir" command and its command output.
Why Needed
Without the "SWIFTFLAGS" options, on Windows 10 swiftc gets: error: clang: error: no such file or directory: 'C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\swift\windows\x86_64\swiftrt.obj'. :0: error: link command failed with exit code 1 (use -v to see invocation)
Without the "-o", swiftc produces an executable file with no .exe extension.
If you use "SWIFTFLAGS" and "-o", but without the "-use-ld=lld -Xlinker -debug:dwarf", on Windows 10 the lldb breakpoint command "b 2" (as shown in Getting Started) gets: error: No selected frame to use to find the default file. error: No file supplied and no default file available.
Most breakpoint commands fail similarly, I did find one that does not elicit an error: "b main". However after giving the "r" run command, lldb breaks at main, but then shows assembly code instead of swift source code.
I found these options in the build commands made available in VS Code when you have the 'Swift' extension. (THANKS!)
Environment
This is needed for Swift 5.6.1 on Windows 10, and probably prior versions.
References
These changes for Getting Started were first requested in the following issues, before Getting Started was open-sourced:
SWIFTFLAGS/-o -- swiftlang/swift#58435
-use-ld=lld -Xlinker -debug:dwarf -- swiftlang/swift#58449
The text was updated successfully, but these errors were encountered:
@0xTim Thanks for looking at this so quickly! I can't work on this in the immediate future, but if it's still open after, I would be happy to take a stab at it!
Page and Section
Page: Swift - Getting Started
Section: Using the LLDB Debugger
Requested Change
Where it says to run:
swiftc -g Factorial.swift
please convert these instructions to be platform based, perhaps using the On macOS/On Linux/On Windows technique used elsewhere on the page. Then in the Windows section, replace the swiftc command with the following:
set SWIFTFLAGS=-sdk %SDKROOT% -I %SDKROOT%\usr\lib\swift -L %SDKROOT%\usr\lib\swift\windows
swiftc -g -use-ld=lld -Xlinker -debug:dwarf Factorial.swift -o Factorial.exe %SWIFTFLAGS%
The "ls" command should also be replaced with the "dir" command and its command output.
Why Needed
Without the "SWIFTFLAGS" options, on Windows 10 swiftc gets:
error: clang: error: no such file or directory: 'C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\swift\windows\x86_64\swiftrt.obj'. :0: error: link command failed with exit code 1 (use -v to see invocation)
Without the "-o", swiftc produces an executable file with no .exe extension.
I found these options in: Compiling a simple hello.swift on Windows
If you use "SWIFTFLAGS" and "-o", but without the "-use-ld=lld -Xlinker -debug:dwarf", on Windows 10 the lldb breakpoint command "b 2" (as shown in Getting Started) gets:
error: No selected frame to use to find the default file. error: No file supplied and no default file available.
Most breakpoint commands fail similarly, I did find one that does not elicit an error: "b main". However after giving the "r" run command, lldb breaks at main, but then shows assembly code instead of swift source code.
I found these options in the build commands made available in VS Code when you have the 'Swift' extension. (THANKS!)
Environment
This is needed for Swift 5.6.1 on Windows 10, and probably prior versions.
References
These changes for Getting Started were first requested in the following issues, before Getting Started was open-sourced:
SWIFTFLAGS/-o -- swiftlang/swift#58435
-use-ld=lld -Xlinker -debug:dwarf -- swiftlang/swift#58449
The text was updated successfully, but these errors were encountered: