magick-rust icon indicating copy to clipboard operation
magick-rust copied to clipboard

how to use with image magick installed with MSYS2

Open Xephobia opened this issue 4 years ago • 5 comments

Hello, I am on Windows and use the gnu toolchain for multiple reasons, but when I try to compile I get this panic :

thread 'main' panicked at 'ImageMagick libdirs at `["D:/msys/mingw64/bin/../lib"]` do not contain the required files to either statically
or dynamically link ImageMagick', D:\.cargo\registry\src\github.com-1ecc6299db9ec823\magick_rust-0.14.0\build.rs:220:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

How can I fix this?

Xephobia avatar Mar 10 '21 18:03 Xephobia

Did you try setting IMAGE_MAGICK_DIR or any of the related settings described in the README? That would be the first thing I would try. Otherwise, I don't know as I have never tried using the GNU toolchain. But that doesn't mean you shouldn't ask, I'll try to help as best I can.

nlfiedler avatar Mar 11 '21 00:03 nlfiedler

the msys2 "emulates" an unix/linux file structure, there is some files located on /bin and some on /lib

Xephobia avatar Mar 11 '21 10:03 Xephobia

i could try specifying with IMAGE_MAGICK_LIB_DIRS but there is an : after the disk name

Xephobia avatar Mar 11 '21 10:03 Xephobia

I'm getting this error on Windows using MSVC, and I set IMAGE_MAGICK_LIBS, IMAGE_MAGICK_DIR, and even IMAGE_MAGICK_LIB_DIRS. Even though the lib dir was pointing to the exact dir containing the file it was trying to link to (I checked the output), for some reason it's "not found"

Edit:: Got it to work cross compiling to Android by setting appropriate env vars. Setting appropriate Windows env vars still fails to build

I do want to note though that now it's not getting stuck at "does not contain the required files", but is now getting stuck at linking with "error LNK2019: unresolved external symbol SetMagickResourceLimit"

MolotovCherry avatar Sep 22 '21 03:09 MolotovCherry

this error reproduce on windows10 magick_rust: 0.15,0.16.0 rustc:1.61.0 lib:ImageMagick-7.1.0-Q16-HDRI Community2019\VC\Tools\MSVC\14.29.30133

note: libmagick_rust-ee64cd36e16e1432.rlib(magick_rust-ee64cd36e16e1432.magick_rust.a42cf69e-cgu.1.rcgu.o) : error LNK2019: unresolved external symbol SetMagickResourceLimit referenced in function _ZN11magick_rust4wand6magick10MagickWand18set_resource_limit17h78a39bf86e3801fdE target\debug\deps\rust_microservice.exe : fatal error LNK1120: 1 unresolved externals

error LNK2019: unresolved external symbol SetMagickResourceLimit referenced in function _ZN11magick_rust4wand6magick10MagickWand18set_resource_limit17hae73b655b83b1af0E

same code buid pass on centos7,centos8

liyunde avatar May 20 '22 06:05 liyunde