-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add missing installation step for Windows #1584
Add missing installation step for Windows #1584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, apart from that, it looks good.
Thanks!
book/src/installation_windows.md
Outdated
### Ensure your linker can find GTK's library files | ||
|
||
Open `%HOMEPATH%\.cargo\config` for editing. You can add extra flags for your linker here to tell it where GTK's library files are. If you're using LLVM's linker with the `stable-x86_64-pc-windows-msvc` Rust toolchain, your config may look like this: | ||
|
||
```toml | ||
[target.x86_64-pc-windows-msvc] | ||
linker = "lld-link.exe" | ||
rustflags = ["-C", "link-args=/LIBPATH:C:\\gtk-build\\gtk\\x64\\release\\lib\\"] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that's only necessary if you use lld
?
If yes, please make that clear here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to use it when using the default linker, I just didn't research the appropriate flag to do so. Here's what happens when I remove my ~/.cargo/config
:
error: linking with `link.exe` failed: exit code: 1181
(...)
= note: LINK : fatal error LNK1181: cannot open input file 'gobject-2.0.lib'
This works fine for me:
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-args=/LIBPATH:C:\\gtk-build\\gtk\\x64\\release\\lib\\"]
It looks like both linkers support the same flag, so I'll update the documentation accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why I didn't have to do that, but oh well.
Let's add it :)
Rewrite it a bit and document the linker configuration step.
0666fd3
to
a1fe0db
Compare
Initially the instructions didn't work for me, but I was able to figure out that I was missing a bit of linker configuration. I documented this requirement and rewrote other parts of the Windows documentation a little bit.