sstadick / gzp

Multi-threaded Compression
The Unlicense
155 stars 14 forks source link

error when target is i686-pc-windows-msvc #18

Open QiWei opened 3 years ago

QiWei commented 3 years ago
  = note: liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_alloc_decompressor referenced in function __ZN11libdeflater12Decompressor3new17hf31a74519cf4bcd1E
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_gzip_decompress referenced in function __ZN11libdeflater12Decompressor15gzip_decompress17hde9a1276df679f8cE
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_zlib_decompress referenced in function __ZN11libdeflater12Decompressor15zlib_decompress17hce9268d56b6995e5E
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_deflate_decompress referenced in function __ZN11libdeflater12Decompressor18deflate_decompress17h5546d5b293d64f6cE
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_free_decompressor referenced in function __ZN67_$LT$libdeflater..Decompressor$u20$as$u20$core..ops..drop..Drop$GT$4drop17h9c4c188330724ceeE
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_alloc_compressor referenced in function __ZN11libdeflater10Compressor3new17h9374eb469501ac7aE
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_deflate_compress_bound referenced in function __ZN11libdeflater10Compressor22deflate_compress_bound17h4313659dcc1e1e3fE
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_deflate_compress referenced in function __ZN11libdeflater10Compressor16deflate_compress17hae2d861b3dc9d63dE
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_zlib_compress_bound referenced in function __ZN11libdeflater10Compressor19zlib_compress_bound17h047ad95075c7dac8E
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_zlib_compress referenced in function __ZN11libdeflater10Compressor13zlib_compress17h5c62d3f235f4ec27E
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_gzip_compress_bound referenced in function __ZN11libdeflater10Compressor19gzip_compress_bound17h03ff8ed43415946cE
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_gzip_compress referenced in function __ZN11libdeflater10Compressor13gzip_compress17h9aee05245d69c40aE
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_free_compressor referenced in function __ZN65_$LT$libdeflater..Compressor$u20$as$u20$core..ops..drop..Drop$GT$4drop17hf882442a05e00411E
          liblibdeflater-a26db91458bc2d2e.rlib(libdeflater-a26db91458bc2d2e.libdeflater.c676b24c-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol _libdeflate_crc32 referenced in function __ZN11libdeflater3Crc6update17h1dbd33df57087956E
sstadick commented 3 years ago

Reproduced in CI: https://github.com/sstadick/gzp/runs/3569336629?check_suite_focus=true

sstadick commented 3 years ago

@QiWei thanks for making an issue! I've started looking into this but don't have a good windows setup to debug this on at the moment outside of CI. I've opened an issue in the libdeflater crate, which is where the fix will likely need to happen.

In the meantime you can disable default features for gzp and set the "deflate_default,snappy_default" features manually and everything should "just work", with a bit of a performance hit because libdeflater is so fast (but it is slower on 32 bit...).

Passing CI for i686-pc-windows-msvc with the above mentioned features: https://github.com/sstadick/gzp/runs/3569445386?check_suite_focus=true

nh13 commented 1 year ago

@sstadick hit this recently for the same target, and your suggestion fixed it! Perhaps this should be added to the README?

sstadick commented 1 year ago

Link added in the README! Thanks for the call out 👍

An issue to keep half an eye is this one: https://github.com/sstadick/gzp/issues/44

zune should be able to replace libdeflate, and be as or more performant, while being pure rust. I haven't had time to get into it yet, but it seems very promising. Currently the impl is asymmetrical and I may not support it till it can both compress and decompress.