keysubtracter icon indicating copy to clipboard operation
keysubtracter copied to clipboard

collect2 error.

Open sari777 opened this issue 3 years ago • 2 comments

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 of DoublingG'; /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"

sari777 avatar Nov 11 '22 18:11 sari777

just downgrade gcc to -v 7

saleh-dev-edge avatar Feb 03 '23 15:02 saleh-dev-edge

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

BusinessEmpireAdmin avatar Jun 17 '24 09:06 BusinessEmpireAdmin