NoraCodes / rust-mingw64-gtk-docker

Cross-build environment for Rust GTK+ apps from Linux to Windows.
Other
10 stars 2 forks source link

Some *.dll not found in Win10 (e.g. libcairo-gobject-2.dll) #1

Open asteding opened 4 years ago

asteding commented 4 years ago

Hello @NoraCodes i stumbled arcross your post and thought i might give it a try since i need to crosscompile from linux to windows.

I followed the instruction on your repo and build a windows .exe of the gtk-rs minimum example found at their page. Sadly if i try start the .exe on my Windows 10 (x64) i get several errors at startup. E.g.

What am i doing wrong? I'd like the approach and if it's simple to use i'd switch to rust for my next little project instead of a PyQt GUI.

Thanks for any help, have a nice day.

olback commented 4 years ago

Take a look here: https://gtk-rs.org/docs-src/tutorial/cross#packaging

You need to include the dlls from the docker container. They are located in /usr/x86_64-w64-mingw32/sys-root/mingw/bin.

Edit: I made two new docker images to be able to compile Rust GTK-3 applications for Linux and Windows on CircleCI. You can find examples here: https://github.com/olback/dockerimages/tree/master/dockerfiles

arifd commented 3 years ago

I just compiled my first gtk-rs app natively in Windows, but had the same problem when I tried to distribute the .exe to another Windows machine. Is there a way to bundle the .dlls into the executable?

NoraCodes commented 3 years ago

You can use an application packing framework or create an MSI installer to distribute the DLLs.

arifd commented 3 years ago

Thanks @NoraCodes, I meant statically bundle the libs, but yes i guess creating an installer works too. Thanks for everything you do!

NoraCodes commented 3 years ago

Absolutely! I think it is possible to statically bundle them, but better not to because a lot of people will already have them installed, so if you provide an installer that checks for them you can reduce install size and update burden.

Best of luck!