Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails with gcc 10.2.0 in msys2 ('multiple definition of' linking error) #1

Closed
rwbc opened this issue Feb 21, 2021 · 2 comments

Comments

@rwbc
Copy link

rwbc commented Feb 21, 2021

Hi Jay,

$ make
gcc -O3 -std=gnu11 -Wall -Wextra -Wshadow -flto -march=native -static *.c -o berserk
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccO5hkMQ.o (symbol from plugin):(.text+0x0): multiple definition of `zobristPieces'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccO5hkMQ.o (symbol from plugin):(.text+0x0): multiple definition of `zobristEpKeys'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccO5hkMQ.o (symbol from plugin):(.text+0x0): multiple definition of `zobristCastleKeys'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccO5hkMQ.o (symbol from plugin):(.text+0x0): multiple definition of `zobristSideKey'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\cc7aEOno.o (symbol from plugin):(.text+0x0): multiple definition of `baseMaterialValues'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccIVGumi.o (symbol from plugin):(.text+0x0): multiple definition of `baseMaterialValues'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccxfj1SO.o (symbol from plugin):(.text+0x0): multiple definition of `baseMaterialValues'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccPPcc0T.o (symbol from plugin):(.text+0x0): multiple definition of `baseMaterialValues'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccC6o3Ig.o (symbol from plugin):(.text+0x0): multiple definition of `zobristPieces'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccC6o3Ig.o (symbol from plugin):(.text+0x0): multiple definition of `zobristEpKeys'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccC6o3Ig.o (symbol from plugin):(.text+0x0): multiple definition of `zobristCastleKeys'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccC6o3Ig.o (symbol from plugin):(.text+0x0): multiple definition of `zobristSideKey'; C:\msys64\tmp\cc8m3SUt.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:9: all] Error 1

Multiple definition of is a typical error for newer gcc versions. (it dislikes header redefining used in various c files)

https://stackoverflow.com/questions/17764661/multiple-definition-of-linker-error
https://mersenneforum.org/showthread.php?p=565756

I would like to compile a non-popcnt version for my hardware and already received requests for hardware
just using ssse3. (w and w/o popcnt)

Guenther

@jhonnold
Copy link
Owner

Fixed on most recent commit

@rwbc
Copy link
Author

rwbc commented Feb 21, 2021

Thanks for the quick fix!
Compiles w/o any warning now.

Guenther

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants