gwihlidal / intel-tex-rs

Rust bindings for Intel's ISPC texture compression
Apache License 2.0
23 stars 4 forks source link

Bundled libraries compiled with `/MD` causes linking errors #7

Open tomaka opened 2 weeks ago

tomaka commented 2 weeks ago

The cc crate in the Rust ecosystem passes either /MT or /MD based on the features of the target: https://github.com/rust-lang/cc-rs/blob/eddc1fd3f944c2e00e9f067a6373b28868b54bcd/src/lib.rs#L1884-L1890

By default, this leads to /MT being passed, at least on my machine.

Unfortunately, the binaries bundled with this crate have apparently been compiled with /MD. The consequence is that trying to link this library alongside with any other library that uses cc leads to linking errors such as:

error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in libintel_tex_2-51baef77d4150a15.rlib(ispc_texcomp_astc.o)

MarijnS95 commented 2 weeks ago

With the error message containing libintel_tex_2, this issue should probably be transferred to https://github.com/Traverse-Research/intel-tex-rs-2 (one of the many forks because this original one has been ignored and unmaintained).

tomaka commented 2 weeks ago

https://github.com/Traverse-Research/intel-tex-rs-2 doesn't seem to have an "issues" tab