Skip to content
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

Update windows.md #3778

Closed
wants to merge 1 commit into from
Closed

Update windows.md #3778

wants to merge 1 commit into from

Conversation

Womoemy
Copy link

@Womoemy Womoemy commented Apr 19, 2024

Modified the command to choose the 64-bit GNU toolchain as the linker. The previous one didn't work as intended and returned an error.

Modified the command to choose the 64-bit GNU toolchain as the linker
@ehuss
Copy link
Contributor

ehuss commented Apr 19, 2024

The original command looks correct to me. Can you show what error you got?

@Womoemy
Copy link
Author

Womoemy commented Apr 20, 2024

Alright. Let me describe the error I faced in detail.
Following instructions in the Rust Book tutorial, I ran rustc main.rs to compile my program and it exited with this error rustc main.rs error: linking with link.exe failed: exit code: 1.
A Google search of the error and I got results that linked back to the Rust Book docs suggesting I change the default toolchain,
then as stated in the docs I ran rustup set default-host x86_64-pc-windows-gnu and nothing happened then I tried to re-compile my program, I got this error message
firsterror

So, I saw another result from Stack Overflow to try this other variation of the command rustup default stable-x86_64-pc-windows-gnu and viola
firstsuccess
then I retried compiling my program and it compiled.
Hence I just thought to leave a PR.

P.S.: I appreciate your prompt feedback, it speaks much about the health of the project and the dedication of the team. Kudos!

@rami3l
Copy link
Member

rami3l commented Apr 20, 2024

@Womoemy Thanks for sending this PR! Looks like you're setting up Rust on Windows with MSVC.

On the one hand, the Rust Book is aware that its instructions for Windows/MSVC users are not clear enough, so recently a change has been made (rust-lang/book#3616) to make them point to the relevant section of the Rustup User Guide.

For the moment being, you can use the latter link for the MSVC setup instructions.

On the other hand, if you want to use Windows/GNU instead, rustup set default-host x86_64-pc-windows-gnu is the correct command to change the default host triple, there's nothing to be changed about that.

However, we do recognize that the step above is not enough to change the default toolchain being used (i.e. you need to run rustup default stable again), and that might cause confusion. #3651 has been tracking this very issue, and we expect to address it soon.

Given the two points above, I'm closing this PR now. Thanks again for offering your help to improve the Rustup project, and have a nice day!

@rami3l rami3l closed this Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants