jvirkki / dupd

CLI utility to find duplicate files
http://www.virkki.com/dupd
GNU General Public License v3.0
113 stars 16 forks source link

Compiling Error multiple definition of `stats_lock' #41

Closed Sepero closed 3 years ago

Sepero commented 3 years ago

Release 1.7, building on Debian Testing

$ make
cc -Wall -Wextra -std=gnu99 -O3 -D_FILE_OFFSET_BITS=64 -DDIRENT_HAS_TYPE -DUSE_FIEMAP /mnt/4/dupd/dupd-1.7/build/copying.o /mnt/4/dupd/dupd-1.7/build/dbops.o /mnt/4/dupd/dupd-1.7/build/dirtree.o /mnt/4/dupd/dupd-1.7/build/filecompare.o /mnt/4/dupd/dupd-1.7/build/hash.o /mnt/4/dupd/dupd-1.7/build/hashers.o /mnt/4/dupd/dupd-1.7/build/hashlist.o /mnt/4/dupd/dupd-1.7/build/main.o /mnt/4/dupd/dupd-1.7/build/optgen.o /mnt/4/dupd/dupd-1.7/build/paths.o /mnt/4/dupd/dupd-1.7/build/readlist.o /mnt/4/dupd/dupd-1.7/build/refresh.o /mnt/4/dupd/dupd-1.7/build/report.o /mnt/4/dupd/dupd-1.7/build/scan.o /mnt/4/dupd/dupd-1.7/build/sizelist.o /mnt/4/dupd/dupd-1.7/build/sizetree.o /mnt/4/dupd/dupd-1.7/build/stats.o /mnt/4/dupd/dupd-1.7/build/test_hashlist.o /mnt/4/dupd/dupd-1.7/build/testing.o /mnt/4/dupd/dupd-1.7/build/utils.o /mnt/4/dupd/dupd-1.7/build/xxhash.o  \
    -lsqlite3 -lcrypto -lpthread -lm -o dupd
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/filecompare.o:(.bss+0x0): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/hash.o:(.bss+0x0): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/hashers.o:(.bss+0x0): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/hashlist.o:(.bss+0x0): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/main.o:(.bss+0x120): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/paths.o:(.bss+0x20): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/readlist.o:(.bss+0x20): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/scan.o:(.bss+0x80): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/sizelist.o:(.bss+0x0): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/sizetree.o:(.bss+0x0): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/stats.o:(.bss+0x1a0): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
/usr/bin/ld: /mnt/4/dupd/dupd-1.7/build/utils.o:(.bss+0x0): multiple definition of `stats_lock'; /mnt/4/dupd/dupd-1.7/build/dbops.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:117: dupd] Error 1

I tried to look up the error, and came across the following link. I don't know if this helps or not.

https://stackoverflow.com/questions/7757234/how-do-i-understand-this-compiler-error-multiple-definition-of

jvirkki commented 3 years ago

Should be now fixed in branch 1.7.1

Sepero commented 3 years ago

I didn't see a release for 1.7.1, so I did git clone https://github.com/jvirkki/dupd and make compiled without error.

I hope I did it correctly. Thank you

jvirkki commented 3 years ago

I hadn't tagged 1.7.1 as a release yet, it is now done.

If you clone the master branch, that's the ongoing development code. It should likely work, but it is not a released version.

If you need a stable version, best to build from a release tag instead.