koraa / xxhrs

Safe XXHash and XXH3 bindings for rust.
9 stars 5 forks source link

Linker fails #9

Closed brmmm3 closed 4 years ago

brmmm3 commented 4 years ago

When I try to use XXH3_64 then the linker fails with the below error message.

let mut hasher = XXH3_64::default();

Error message:

= note: /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH_versionNumber': xxhash_bindings.c:(.text.XXH_versionNumber+0x0): multiple definition of XXH_versionNumber'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH_versionNumber+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32': xxhash_bindings.c:(.text.XXH32+0x0): multiple definition of XXH32'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32_createState': xxhash_bindings.c:(.text.XXH32_createState+0x0): multiple definition of XXH32_createState'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32_createState+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32_freeState': xxhash_bindings.c:(.text.XXH32_freeState+0x0): multiple definition of XXH32_freeState'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32_freeState+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32_copyState': xxhash_bindings.c:(.text.XXH32_copyState+0x0): multiple definition of XXH32_copyState'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32_copyState+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32_reset': xxhash_bindings.c:(.text.XXH32_reset+0x0): multiple definition of XXH32_reset'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32_reset+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32_update': xxhash_bindings.c:(.text.XXH32_update+0x0): multiple definition of XXH32_update'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32_update+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32_digest': xxhash_bindings.c:(.text.XXH32_digest+0x0): multiple definition of XXH32_digest'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32_digest+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32_canonicalFromHash': xxhash_bindings.c:(.text.XXH32_canonicalFromHash+0x0): multiple definition of XXH32_canonicalFromHash'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32_canonicalFromHash+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH32_hashFromCanonical': xxhash_bindings.c:(.text.XXH32_hashFromCanonical+0x0): multiple definition of XXH32_hashFromCanonical'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH32_hashFromCanonical+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64': xxhash_bindings.c:(.text.XXH64+0x0): multiple definition of XXH64'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64_createState': xxhash_bindings.c:(.text.XXH64_createState+0x0): multiple definition of XXH64_createState'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64_createState+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64_freeState': xxhash_bindings.c:(.text.XXH64_freeState+0x0): multiple definition of XXH64_freeState'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64_freeState+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64_copyState': xxhash_bindings.c:(.text.XXH64_copyState+0x0): multiple definition of XXH64_copyState'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64_copyState+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64_reset': xxhash_bindings.c:(.text.XXH64_reset+0x0): multiple definition of XXH64_reset'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64_reset+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64_update': xxhash_bindings.c:(.text.XXH64_update+0x0): multiple definition of XXH64_update'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64_update+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64_digest': xxhash_bindings.c:(.text.XXH64_digest+0x0): multiple definition of XXH64_digest'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64_digest+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64_canonicalFromHash': xxhash_bindings.c:(.text.XXH64_canonicalFromHash+0x0): multiple definition of XXH64_canonicalFromHash'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64_canonicalFromHash+0x0): first defined here /usr/bin/ld: /tmp/rustcVeHEj9/libxxhrs-da839f8fff1f4d6b.rlib(xxhash_bindings.o): in functionXXH64_hashFromCanonical': xxhash_bindings.c:(.text.XXH64_hashFromCanonical+0x0): multiple definition of XXH64_hashFromCanonical'; /tmp/rustcVeHEj9/libzstd_sys-cc185a7370b57c5d.rlib(xxhash.o):xxhash.c:(.text.XXH64_hashFromCanonical+0x0): first defined here collect2: error: ld returned 1 exit status

koraa commented 4 years ago

You're linking against libzstd and libxxhrs, are you?

koraa commented 4 years ago

Probably fixed. Please do not open issues unless you intend to work constructively on fixing issues.