pevers / gdcm-rs

GDCM bindings for Rust
7 stars 6 forks source link

Feature gate charls #12

Closed dougyau closed 1 year ago

dougyau commented 1 year ago

This feature gates the linking of gdcmcharls as it conflicts when trying to link libcharls on the project (this is useful when using libcharls to encode jpeg-ls).

dougyau commented 1 year ago

When bindgen with charls https://github.com/coradoya/charls-sys is used on static compilation mode, and gdcm-rs is used as well, the linker will throw an error due to duplicated symbols.

GDCM includes it's own version of charls (an old version btw). So another posible solution would be to add bindings to the custom gdcm charls implementation, but I think it is better to use the current official version of the library to encode to jpeg-ls.

As both libraries expose the same symbols (so the conflict) once the linker uses the newer version of charls it does compile and it works, as the symbols expected by GDCM are still present on charls current tree (and will be there until 3.x happens).

pevers commented 1 year ago

Thanks for explaining. Makes a lot of sense!