aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
310 stars 85 forks source link

Cannot compile on Win 11 #264

Closed s-simoncelli closed 11 months ago

s-simoncelli commented 11 months ago

Hello,

I currently cannot compile the crate with the following error:

error[E0308]: mismatched types
   --> C:\Users\netce\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hdf5-0.8.1\src\globals.rs:44:68
    |
44  |         pub static $rust_name: H5GlobalConstant = H5GlobalConstant($c_name);
    |                                                   ---------------- ^^^^^^^ expected `&usize`, found `&i64`
    |                                                   |
    |                                                   arguments to this struct are incorrect
...
320 | link_hid!(H5E_BADSIZE, h5e::H5E_BADSIZE);
    | ---------------------------------------- in this macro invocation
    |
    = note: expected reference `&'static usize`
               found reference `&'static i64`
note: tuple struct defined here
   --> C:\Users\netce\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hdf5-0.8.1\src\globals.rs:19:12
    |
19  | pub struct H5GlobalConstant(
    |            ^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `link_hid` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0308`.
error: could not compile `hdf5` (lib) due to 264 previous errors

I'm using version 0.8.1 with the static feature and the MSVC compiler

mulimoen commented 11 months ago

This has something to do with msvc_dll_indirection which should not be set on static builds. Do you by any chance have the environment variable HDF5_DIR set? If you do, try unsetting it

s-simoncelli commented 11 months ago

Thanks that;s solved the issue :)