-
Notifications
You must be signed in to change notification settings - Fork 36
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
windows 10 build fatal error LNK1181: cannot open input file 'gtk-3.lib' #29
Comments
The missing resources are corrected by copying the icons from msys's resources into vcpkg:
Can't save the todo list yet because I get the following error about another missing resource:
|
I found that missing svg file here:
From some other documentation I found. You can do this:
After that, the open file todo dialog and the save as file todo dialog behave correctly. |
On windows 10, after reinstalling msvc2019/rust nightly/vcpkg/openssl/gtk, I tried rebuilding....the compile seems ok, but the linker is always giving me troubles. errVgtkMsvc2019Win10BuildOutput.txt Thank you. |
I just noticed there is continuous integration testing for vgtk. Thank you. |
Ok so I discovered bodil/vgtk uses github's new products for continuous integration called "Github Actions". From within there, we can find some virtual environments to build from as documented here: Crazy powerful!!! What a way to discover "Github Actions". Please could you change the continous integration to run "cargo build --release --verbose --verbose" in order to see more information about the linker library paths and import libs? Thank you. |
Github Actions is so nice. The story for building gtk-rs on Windows isn't great, but they've written up a procedure for it here: https://gtk-rs.org/docs-src/requirements#windows - at least it's not something end users would have to do if you package it up correctly, but exactly how to do that is a story as yet unwritten, too. I'll tweak the CI as you suggested, that's probably a good idea for any build. |
with msvc2019 configured here is what I needed to do to build todomvc.exe
|
Ok so I believe I found the culprit for the link error.
mentions
but it goes on....
SUMMARY Ok so there were a lot of assumptions here. It assumed we had some environment variables set which were not documented anywhere. The only way to know about these is to read the sources for gtk-sys-0.9.2\build.rs. Last question: Did you actually set these variables yourself outside of vgtk project somewhere and make an assumption that others would have to do the same? Again this is in the lens that we want many others to build vgtk successfully and have them using it successfully in order to have many others contribute to the vgtk community. Thank you again. |
The yml should mention these extra few environment variables. After that, it can be considered resolved I think. On MS Windows 10, this successfully compiles and links. I was missing a few more environment variables that needed to be set:
DO SET THE LIB ENVIRONMENT VARIALBLE! |
Here is what the above successfully built looks like:
vgtkBuildOutput23Jan2020.txt |
Same problem here. |
Closing this as it's a gtk-rs upstream issue. |
Ok so I have resolved this linker error manually, but I don't know where to put it into the Cargo.toml.
BUILD ERROR:
So to resolve this from start to finish:
2)cd to vcpkg directory
3)initialize msvc environment for 64-bit windows
4)invoke a powershell
5)set the vcpkg_root to where it exists
6)set the vcpkgrs_dynamic
7)set the path to contain the vcpkg installed packages for x64.
Please note there is one directory containing the binaries for gtk dlls (/bin/) and another directory containing the libraries to link with at the rust/msvc link stage.(/lib/)
8)install the gtk package for 64-bit windows
9)cd vgtk
10)clean the cargo building
11)now rebuild vgtk with verbose using the rust nightly compiler and ensure you are using the msvc c/c++ developer tools and now the msys c++ tools:
12)everything compiled correctly, but the linker failed.
That was because cargo didn't point to the correct library path for the linking.
It needs:
Also within cargo there is a spec to link with gtk-3.lib when it should be gtk-3.0.lib.
Relink with this which corrects the issue and points to the correct gtk-3.0.lib:
The text was updated successfully, but these errors were encountered: