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

error: linking with link.exe failed: exit code: 1181 #1477

Open
Nucl3arSn3k opened this issue Aug 22, 2023 · 6 comments
Open

error: linking with link.exe failed: exit code: 1181 #1477

Nucl3arSn3k opened this issue Aug 22, 2023 · 6 comments

Comments

@Nucl3arSn3k
Copy link

When i included the Rust GTK binding library in my project, and attempted to build it,I got this error.

error: linking with link.exe failed: exit code: 1181

with the note that
note: LINK : fatal error LNK1181: cannot open input file 'gobject-2.0.lib'

For the record,I'm executing this code on a Windows machine after installing gtk4 via MSYS2

@Nucl3arSn3k Nucl3arSn3k added the bug Something isn't working label Aug 22, 2023
@MarcGuiselin
Copy link

You can fix this by adding the path to the gdx build lib directory that contains gobject-2.0.lib (C:\gtk-build\gtk\x64\release\lib in my case) to either the LIB, LIBPATH or PATH environment variables.

If you used gvsbuild (which I assume since you're on windows), this is mentioned in the install steps: https://github.com/wingtk/gvsbuild#add-gtk-to-your-environmental-variables

But there's a caveat that the command they list on their README doesn't actually alter environment variables globally (it only does so in the current shell). I realized this after reading through he guide again.

Since this isn't an issue with gtk-rs I suggest this issue be closed.

@nazar-pc
Copy link
Contributor

nazar-pc commented Dec 4, 2023

I just hit this today after carefully following instructions with gvsbuild. I think this information should be added to the book before closing. I have added it to LIB.

@bilelmoussaoui
Copy link
Member

@nazar-pc mind sending a PR?

@bilelmoussaoui bilelmoussaoui added book and removed bug Something isn't working labels Jan 20, 2024
@nazar-pc
Copy link
Contributor

Well, interestingly this was only needed in GitHub Actions CI, it worked fine without LIB on Windows 10 installation I have in a VM locally.

@bilelmoussaoui
Copy link
Member

Well, interestingly this was only needed in GitHub Actions CI, it worked fine without LIB on Windows 10 installation I have in a VM locally.

Would you mind sharing a link to your actions file? it could be useful for either future chapters or people wanting to test their app on windows

@nazar-pc
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants