albertobsd / keysubtracter

Bitcoin and Altcoins Publickey subtracter
BSD 2-Clause "Simplified" License
42 stars 34 forks source link

collect2 error. #35

Open sari777 opened 2 years ago

sari777 commented 2 years ago

dear alberto, can you please resolve this issue. it is during make. on ubuntu linux "gcc -O3 -c sha256/sha256.c -o sha256.o gcc -O3 -c base58/base58.c -o base58.o gcc -O3 -c rmd160/rmd160.c -o rmd160.o gcc -O3 -c gmpecc.c -o gmpecc.o gcc -O3 -c util.c -o util.o gcc -o keysubtracter keysubtracter.c gmpecc.o util.o sha256.o base58.o rmd160.o -lgmp /usr/bin/ld: gmpecc.o:(.bss+0x2020): multiple definition of EC'; /tmp/ccw0Inn5.o:(.bss+0x0): first defined here /usr/bin/ld: gmpecc.o:(.bss+0x0): multiple definition ofDoublingG'; /tmp/ccw0Inn5.o:(.bss+0x40): first defined here /usr/bin/ld: gmpecc.o:(.bss+0x2000): multiple definition of `G'; /tmp/ccw0Inn5.o:(.bss+0x20): first defined here collect2: error: ld returned 1 exit status make: *** [Makefile:7: default] Error 1"

saleh-dev-edge commented 1 year ago

just downgrade gcc to -v 7

BusinessEmpireAdmin commented 5 months ago

just add this lines to gmpecc.c after all includes on line 4:

struct Elliptic_Curve EC; struct Point G; struct Point DoublingG[256];

and in gmpecc.h add "extern" to lines 22-24: extern struct Elliptic_Curve EC; extern struct Point G; extern struct Point DoublingG[256];

thats all. my gcc 11+ compiled succesfully