nlfiedler / magick-rust

Rust bindings for ImageMagick
https://crates.io/crates/magick_rust
Apache License 2.0
246 stars 63 forks source link

how to distribute the rust executable and dll #107

Open dassio opened 11 months ago

dassio commented 11 months ago

when installed ImageMagick and successfully build it on my windows pc, the final Rust executable worked anywhere but then transfer the final executable to another PC, it does not work:

  1. when not DLL is located with the final executable, nothing prints when invoked
  2. when copying the ImageMagick DLL to the same dir of the final executable, it complains failed to read image
  3. then I install ImageMagick on the new PC, and everything works

when how should I distribute the final executable?

nlfiedler commented 11 months ago

My Windows developer experience is more than 20 years out of date, so I can't speak to the best approach for producing a static binary, or if that is even possible. But that is the basic problem: there is an executable that is trying to find the necessary libraries, and that includes ImageMagick itself. Hence, installing ImageMagick resolves the issue, but expecting a user to do that is a bit much, so I admit this is problematic. However, I don't have any idea of a good solution.