-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Windows 10, swiftc gets error regarding swiftrt.obj #58435
Comments
@shahmishal, I see this documentation issue was not fixed in the recent release of 5.6.2. Did I classify this incorrectly as a 'bug'? It is not a fix to the code base - just a fix to the documentation page, which could be made at any time. Just wondering if I submitted this correctly because I am new to GitHub. Note, the same question applies to several other issues I submitted, e.g.,
Thanks for any thoughts! |
@Kim4444 the web documentation is not in this repository. The changes for that should be submitted to https://github.com/apple/swift-org-website |
@compnerd, Thanks for pointing that out. That has been done and I will review my other changes for the same. |
I am closing this, since I had resubmitted it as: |
closed |
@gandalfas For the future, consider asking us to transfer the issue instead. This allows us to avoid duplication and minimize the amount of irrelevant issues in the database. |
@AnthonyLatsis , I will surely do that - I definitely want to use best practices. And I do have more issues to review and move to swift-org-website. I will reference your name in those. I would note though, that in some of these cases that you have closed for me today, the issue in here (apple/swift) did not match one for one with the new issue created on swift-org-website. In one case, one of three items I raised initially (~ a year ago) had been fixed, so that is not mentioned at all in the new issue on swift-org-website. And in another case, 3 issues here were closed and are best represented by one new issue on swift-org-website. Thus for these non 1-to-1 types, a straight transfer of the issue would not be correct. I guess for these kinds of cases I can ask for advice. Also, I thought that today I had successfullly Closed-with-Comment this issue and others. But clearly I have caused you to have to close these issues - sorry to make work for you. I am a bit new to Github - did I not close them correctly? Thanks for your guidance! |
Thanks!
In this case we could have manually linked (or referenced in a comment) the PR that fixed the item after the transfer and left the issue open.
Personally, I would still vote for transferring all three and, depending on why they are best represented by a single issue, either close two as duplicates of the third or leave them to eventually be closed individually.
No biggie, I simply re-closed them with the status GitHub suggests for duplicates ('not planned'). |
This is due to a "bug" in the page Swift - Getting Started for Windows 10. Below, after describing the issue, I have both a solution for developers using Swift on Windows, and a request to change that page. I am new at Swift, and other thoughts are welcome! And many thanks to all who helped bring Swift to Windows!!! :)
Environment
build number: Swift 5.6.1
OS: Windows 10 desktop computer
Issue Description
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)
Test Case
After an install of Swift on Windows 10, run 'swiftc -g Factorial.swift' as shown on Swift - Getting Started > Using the LLDB Debugger. That elicits the error above.
Cause
Some sdk-related options are missing from the compile.
Solution
Add these options to your compile:
set SWIFTFLAGS=-sdk %SDKROOT% -I %SDKROOT%\usr\lib\swift -L %SDKROOT%\usr\lib\swift\windows
swiftc -g Factorial.swift -o Factorial.exe %SWIFTFLAGS%
I found this in: Compiling a simple hello.swift on Windows
Suggested Documentation Fix
On Swift - Getting Started > Using the LLDB Debugger, where it says to run:
swiftc -g Factorial.swift
add this text after that:
On Windows 10, additional options are needed, and the .exe extension must be requested:
set SWIFTFLAGS=-sdk %SDKROOT% -I %SDKROOT%\usr\lib\swift -L %SDKROOT%\usr\lib\swift\windows
swiftc -g Factorial.swift -o Factorial.exe %SWIFTFLAGS%
The text was updated successfully, but these errors were encountered: