aldanor / hdf5-rust

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

Static builds fails on Windows #280

Closed SteffenSunde closed 7 months ago

SteffenSunde commented 7 months ago

Hi,

Trying to compile statically with HDF5 fails on windows (VS17, rust 1.77.2). Found some useful discussions in here but still have problems.

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



Hope get some help with this. Thank you very much!
mulimoen commented 7 months ago

It is likely the wrong path triggers in https://github.com/aldanor/hdf5-rust/blob/694e900972fbf5ffbdd1a2294f57a2cc3a91c994/hdf5/src/globals.rs#L19 causing the build error. I don't think the build script is clever enough to choose the right library to link and tries the wrong one.

The static feature of hdf5-sys should compile hdf5 from scratch, so you should not need to set HDF5_DIR (or compile the library yourself).

SteffenSunde commented 7 months ago

You're right! Removing the environment variable and rebooting solved the issue. Thank you very much!