kornelski / dssim

Image similarity comparison simulating human perception (multiscale SSIM in Rust)
https://kornel.ski/dssim
GNU Affero General Public License v3.0
1.09k stars 70 forks source link

x86_64-pc-windows-gnu: failure to compile src/main.rc #73

Closed 1480c1 closed 4 years ago

1480c1 commented 4 years ago

running cargo build --release --jobs=2 results in

warning: use of deprecated item 'imgref::Img::buf': Don't access struct fields directly. Use buf(), buf_mut() or into_buf()
   --> src\blur.rs:131:20
    |
131 |         let src = &src.buf[..];
    |                    ^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated item 'imgref::Img::buf': Don't access struct fields directly. Use buf(), buf_mut() or into_buf()
   --> src\blur.rs:132:24
    |
132 |         let dst = &mut dst.buf[..];
    |                        ^^^^^^^

warning: use of deprecated item 'imgref::Img::buf': Don't access struct fields directly. Use buf(), buf_mut() or into_buf()
   --> src\blur.rs:158:37
    |
158 |             do_blur(srcdst.new_buf(&srcdst.buf[..]), tmp_dst);
    |                                     ^^^^^^^^^^

warning: variable does not need to be mutable
   --> src\blur.rs:143:17
    |
143 |             let mut dstrow = &mut dst[y*dst_stride..y*dst_stride+width];
    |                 ----^^^^^^
    |                 |
    |                 help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: 4 warnings emitted

   Compiling dssim v2.11.0 (C:\media-autobuild_suite-master\build\dssim-git)
error[E0277]: `?` couldn't convert the error to `lodepng::ffi::Error`
  --> src/main.rs:46:59
   |
46 |     let img = load_image::load_image(path.as_ref(), false)?;
   |                                                           ^ the trait `std::convert::From<lodepng::error::Error>` is not implemented for `lodepng::ffi::Error`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following implementations were found:
             <lodepng::ffi::Error as std::convert::From<std::io::Error>>
   = note: required by `std::convert::From::from`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `dssim`.

To learn more, run the command again with --verbose.

I cannot test *-msvc since trying to use rust's msvc target will require installing msvc build tools and does not work inside a msys2 shell because cargo tries to use GNU link rather than the one from msvc and it seems installing the 5GB msvc build tools inside a VM doesn't work either since it errors out on LINK : fatal error LNK1181: cannot open input file 'advapi32.lib' from the x64 Native Tools Command Prompt for VS 2019 after setting the proper toolchain.

running cargo build from stable-x86_64-unknown-linux-gnu works fine.

kornelski commented 4 years ago

Run git pull and cargo update. This error has been fixed in the latest version (2.11.1).

1480c1 commented 4 years ago

Thanks, although the warnings are still there, it no longer errors out and compiles successfully